[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
T and NIL.
- To: FAHLMAN at CMU-20C
- Subject: T and NIL.
- From: George J. Carrette <GJC at MIT-MC>
- Date: Tue, 02 Mar 1982 19:59:00 -0000
- Cc: COMMON-LISP at SU-AI
To give some perspective, the things to change in the existing NIL code
to support the T & NIL symbol overloading from lisp 1.5 are:
 Change the type code of the () object to be of type SYMBOL.
 Change every primitive which acts on symbols to have a
special case check like (DEFUN PLIST (X) (%PLIST (SYMBOL-FILTER X))).
where: (DEFUN SYMBOL-FILTER (X)
(IF (SYMBOLP X)
(IF (NULL X) *NIL-SURROGATE* X)
(SYMBOL-FILTER (WRONG-TYPE-ARG-ERROR "Not a symbol" X))))
and %PLIST is the usual open-compiled stucture reference.
 Make the usual changes in the evaluator, special case for T and NIL.
 Make #T read in as T.
 Recompile and reassemble the world.
So you can see that it isn't all that much work, won't slow things
down too much (mainly the evaluator), and won't make things any bigger.
Larger changes, such as changing the calling sequence of most things
in the virtual machine, have been made in NIL in the recent past.
Remember though, this will be in lisp, and not hidden away in microcode,
so users will be able to see the funny stuff going on. It won't be
as if the semantics were built-in to the hardware or engraved on
stones brought down from a mountain top.
Obviously the other more localized way of changing this is to redefine
CAR and CDR to work on the symbol NIL. Totally out of the question
in a non-microcoded implementation.