[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What should LAST of an atom do?
- To: Common-Lisp%su-ai@usc-ecl
- Subject: What should LAST of an atom do?
- From: David A. Moon <MOON%SCRC-TENEX@MIT-MC>
- Date: Mon, 11 Apr 1983 02:30:00 -0000
- Mail-from: ARPANET site SU-AI rcvd at 10-Apr-83 1935-PST
On page 176 of the Laser edition of the Common Lisp manual, it says
that LAST of the empty list should return NIL. It doesn't say anything
about LAST of other atoms.
Page 56 of the Lisp Machine manual says the same thing, but gives an
example (which in fact agrees with the actual behavior) indicating that
LAST of any atom returns that atom.
The Interlisp manual says that LAST of any atom is NIL.
Unfortunately I don't have my Maclisp and Lisp 1.5 manuals here.
However, Maclisp signals an error if LAST is given a non-NIL atom,
even in (*rset nil) mode, but returns NIL if it is given NIL.
The question is: should LAST be redefined to be an error when applied to
an atom, since anything it could return would really be wrong? And
should it be an error even if the atom is NIL? I am inclined to say
"yes" to both of these, but perhaps that would be too much tinkering
with the traditional foundations of Lisp.
This was inspired by two people complaining about not getting an error
for LAST of an atom; in one case the atom was NIL.