test for membership in a data structure, function, or module - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Logic : Boolean : member

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

membery,x,y,z

true

(1)

membery,xy,yz

false

(2)

memberxy,xy,w+u,y

true

(3)

membery,x,y,z

true

(4)

membery,tablex,y,z

true

(5)

memberw,x,y,w,u,'k'

true

(6)

k

3

(7)

memberv,fu,v,w,'k'

true

(8)

k

2

(9)

m:=moduleexporte;end module:

membere,m

true

(10)

membere,m,'p':

p

e

(11)

memberf,m

false

(12)

See Also

function, has, in, list, membertype, module, set


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam