Reputation: 13
If I want to find whether (x 2) exists within a list containing ((x 2) (y 2) (z 2)) for example, how do I do this?
(member '(x 2) '((x 2) (y 2) (z 2)))
returns NIL as does find
Thanks for the help
Upvotes: 0
Views: 2124
Reputation: 18917
? (member '(x 2) '((x 2) (y 2) (z 2)) :test 'equal) ((X 2) (Y 2) (Z 2))
In Common Lisp, member uses eql as the default test, which does not work in this case.
member
eql
See here for details regarding eq, eql, equal and equalp.
eq
equal
equalp
Upvotes: 5