← Back to context

Comment by adrian_b

8 hours ago

What you say may be true for some modern LISPs, but it was false in most early LISPs, certainly in any LISP that has preceded the paper "Record Handling" of Tony Hoare.

I quote from the manual of LISP I: "Here NIL is an atomic symbol used to terminate lists".

I am not sure which is the rule in Common LISP, but in many early LISPs the predicate (atom NIL) was true.

In early LISPs, the end of a list was recognized when its CDR was an atom, instead of being another list. The atom could be different from NIL, because that final list could have been an association pair, pointing towards two associated atoms.

The fact that in early LISPs NIL was an atom, but it was also used to stand for an empty list caused some ambiguities.

EDIT: I have searched now and in Common LISP the predicate (atom NIL) remains true, like in all early LISPs, therefore NIL is still an atom, even if using it almost anywhere is equivalent with an empty list.