In Lisp, the correct list ends in NIL , but you also have invalid lists. One kind of invalid list is a list in which the last cons cell contains an atom other than NIL in its CDR . (1 3 . 2) - This is exactly the wrong list.
You may even have incorrect lists in which it does not have the last cell at all. CAR and CDR are basically just pointers, so you can have circular lists!
In Common Lisp (which CLISP implements), many standard functions will not work with invalid lists as arguments.
Pillsy
source share