SketchyLISP Reference |
Copyright (C) 2007 Nils M Holm |
<<[max] | [Index] | [memp]>> |
Conformance: R5RS Scheme
Purpose:
Return the sublist starting at the first member of a list that
is equal to a given datum. If no such member exists, return
#f.
Arguments:
X - datum to find
A - list
Implementation:
(define (member x a) (cond ((null? a) #f) ((equal? (car a) x) a) (else (member x (cdr a)))))
Example:
(member '(c d) '(a b (c d) e f)) => ((c d) e f)
<<[max] | [Index] | [memp]>> |