SketchyLISP Reference |
Copyright (C) 2007 Nils M Holm |
<<[memq] | [Index] | [min]>> |
Conformance: R5RS Scheme
Purpose:
Return the sublist starting at the first member of a list that
is equivalent to a given atom. If no such member exists, return
#f.
Arguments:
X - atom to find
A - list
Implementation:
(define (memv x a) (cond ((null? a) #f) ((eqv? (car a) x) a) (else (memv x (cdr a)))))
Example:
(memv '4 '(1 2 3 4 5 6)) => (4 5 6)
<<[memq] | [Index] | [min]>> |