BAP Online Manuals : Library Reference : Library by Name : member
Previous: makewindow
Next: menubar

6.2.83. member

matches element with all members of the list

SYNOPSIS

INCLUDE 'prolib'
member(X,[1,2,3,4])

SYNTAX

member(Elem,List) (x,i)

ARGUMENTS

void(Elem) (x) Term to be matched with all list members.
voidlist(List) (i) List to be evaluated.

DESCRIPTION

Member succeeds for any List element that can be matched with Elem.
Its definition is:

PREDICATE member(integer,void).
member(X,[X|_]).
member(X,[_|Tail]):-
	member(X,Tail).

EXAMPLE

member(X,[hello, world]),
	write(X),nl,
	fail.

repeat
	read(Option),
	( member(Option,[test,verbose,extract]),! ;
	  write("Illegal option"),nl, fail
	).

ERRORS

No runtime errors

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

append , remove


BAP Online Manuals : Library Reference : Library by Name : member
Previous: makewindow
Next: menubar