chickadee » ck-macros » c-member

(c-member X L) → '#t or '#fsyntax
(c-member X L '(OP ...)) → '#t or '#fsyntax

Searches the list for the first occurance of X, then yields the tail of the list starting with that item. Yields '#f if the list does not contain X.

Uses '(OP ...) for comparison, or '(c-sym-equal?) if the operation is omitted. So by default, X must be a symbol, list, pair, vector, or nested combination of those things.

Same as (c-find-tail '(OP ... X) L). Roughly analogous to member except for the default allowed types.

(ck () (c-quote (c-member 'b '(a b c))))
;; ==> '(b c)

(ck () (c-quote (c-member 'x '(a b c))))
;; ==> '#f

(ck () (c-quote (c-member '(a b c)
                          '((a) (x y z) (a b))
                          '(c-u=))))
;; ==> '((x y z) (a b))
;; Because (c-u= '(a b c) '(x y z)) yields '#t