On GNU Clisp 2.49, (listp nil) returns true. Could someone explain? Searching found this question with an answer that indicated that the expression should be returning NIL.
1 Answer
In Common Lisp listp returns T for a list. nil is the empty list, so (listp nil) is T. NIL can also be written as ().
CL-USER 38 > (eq (read-from-string "()") (read-from-string "NIL"))
TIn Common Lisp nil has multiple purposes: the symbol named NIL in the COMMON-LISP package, the empty list, the boolean (or generalized boolean) representing false, and the name of the empty type.