member(?Elem,
?List)True if Elem is a member of List. The SWI-Prolog
definition differs from the classical one. Elements that do not unify
with
Elem are skipped in C, without creating a choicepoint for
them. The definition provides determinism on the last element. E.g. this
is deterministic:
member(X, [One]).
- Errors
- -
type_error(list, Tail) if List does not end in []
or a variable.
- type_error(list, List) if List is cyclic and
no element unifies with Elem. See the Prolog flag ill_typed
to make member/2 fail
silently in these cases.