Membership Testing

A list of items can be used as a representation of a set. The function (MEMBER x lst) tests whether the item x is a member of the list lst. If x is a member of lst, the value of MEMBER is the tail of the list lst beginning with the place where x was found; otherwise, the value of MEMBER is NIL. The default test used by MEMBER is EQL.



(SETQ CLUB '(TOM DICK HARRY))

(MEMBER 'DICK CLUB)  =  (DICK HARRY)

(MEMBER 'FRED CLUB)  =  NIL

(MEMBER '(JOHN MARY) COUPLES :TEST #'EQUAL)

Contents    Page-10    Prev    Next    Page+10    Index