member - Maple Help

# Online Help

###### All Products    Maple    MapleSim

member

test for membership in a data structure, function, or module

 Calling Sequence member(x, s, 'p')

Parameters

 x - expression s - set, list, rtable, table, function, or module 'p' - (optional) unevaluated name

Description

 • The function member determines if x is a member of the set, list, Array, Matrix, Vector, table, function, or module s.  It returns true if so, and false otherwise.
 • If s is a table, member tests whether x is a value in the table.
 • If a third argument 'p' is present and member yields true, the position of the first x in s is assigned to p in the case of sets, lists, and functions, while the member instance is assigned to the name p if s is a module.

Thread Safety

 • The member command is thread safe as of Maple 15, provided that the name p, if used, is not shared between threads.
 • For more information on thread safety, see index/threadsafe.

Examples

 > $\mathrm{member}\left(y,\left\{x,y,z\right\}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{member}\left(y,\left\{xy,yz\right\}\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{member}\left(xy,\left[xy,w+u,y\right]\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{member}\left(y,⟨x,y,z⟩\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{member}\left(y,\mathrm{table}\left(\left[x,y,z\right]\right)\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{member}\left(w,\left[x,y,w,u\right],'k'\right)$
 ${\mathrm{true}}$ (6)
 > $k$
 ${3}$ (7)
 > $\mathrm{member}\left(v,f\left(u,v,w\right),'k'\right)$
 ${\mathrm{true}}$ (8)
 > $k$
 ${2}$ (9)
 > $m≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{_export}\left(e\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end module}:$
 > $\mathrm{member}\left(e,m\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{member}\left(e,m,'p'\right):$
 > $p$
 ${e}$ (11)
 > $\mathrm{member}\left(f,m\right)$
 ${\mathrm{false}}$ (12)

Compatibility

 • The s parameter was updated in Maple 15.

 See Also