Function: member
member is a function defined in fns.c.
Signature
(member ELT LIST)
Documentation
Return non-nil if ELT is an element of LIST. Comparison done with equal.
The value is actually the tail of LIST whose car is ELT.
Other relevant functions are documented in the list group.
Probably introduced at or before Emacs version 21.1.
Shortdoc
;; list
(member 2 '(1 2 3))
=> (2 3)
(member "b" '("a" "b" "c"))
=> ("b" "c")
Source Code
// Defined in /usr/src/emacs/src/fns.c
{
if (eq_comparable_value (elt))
return Fmemq (elt, list);
Lisp_Object tail = list;
FOR_EACH_TAIL (tail)
if (! NILP (Fequal (elt, XCAR (tail))))
return tail;
CHECK_LIST_END (tail, list);
return Qnil;
}