In the following Lisp REPL interaction:
CL-USER> (defparameter *unison* 0)
*UNISON*
CL-USER> (member *unison* '(*unison*))
NIL
why is nil returned?
In the following Lisp REPL interaction:
CL-USER> (defparameter *unison* 0)
*UNISON*
CL-USER> (member *unison* '(*unison*))
NIL
why is nil returned?
Because the *unison*
variable is bound to 0
, and the list has only a *unison*
symbol since it's quoted. Try this in comparison:
(member *unison* (list *unison*))
This will actually evaluate the second *unison*
which returns 0
, resulting in a (0)
list.