item | an item to be found |
list | a list to be searched |
test | function key and item comparison |
key | function for extracting value before test |
MEMBER function searches a list for the first occurrence of an element (item) satisfying the test. Return value is tail of the list starting from found element or NIL when item is not found. See also MEMBER-IF, POSITION, POSITION-IF, FIND and FIND-IF.
(member 1 '(0 1 0 0 0 1 0)) => (1 0 0 0 1 0) (member 2 '(0 1 0 0 0 1 0)) => NIL (member #\h '(#\H #\o #\l #\a)) => NIL (member #\h '(#\H #\o #\l #\a) :test #'char-equal) => (#\H #\o #\l #\a) (member #\h '(#\H #\o #\l #\a) :key #'char-downcase) => (#\H #\o #\l #\a)