chickadee » ck-macros » c-member

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

ATTENTION: When using the default comparison operator, this CK-macro has major pitfalls that you should be aware of. If you do not require strict R5RS portability, it is recommended to use the comparison operator '(c-equal?) instead.

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