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
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
? (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.
See here for details regarding eq
, eql
, equal
and equalp
.