[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Plists and NIL.
- To: dml@NADC.ARPA (D. Loewenstern)
- Subject: Plists and NIL.
- From: STEVER%OZ.AI.MIT.EDU@XX.LCS.MIT.EDU
- Date: Fri, 10 Jul 1987 01:59:00 -0000
- Cc: common-lisp@SAIL.STANFORD.EDU
- In-reply-to: Msg of 9 Jul 1987 09:16-EDT from dml at nadc.arpa (D. Loewenstern)
Date: Thursday, 9 July 1987 09:16-EDT
From: dml at nadc.arpa (D. Loewenstern)
1) NIL is a symbol. Like all symbols, it has a plist (see CLtL p.4 for an
2) NIL is a list.
Therefore, does (SETQ z NIL)
(SETF (GETF z :a) :b)
return NIL or (:a :b)? (That is, does the property go on NIL's plist or
directly into the list referenced by z?)
It goes into the list referenced by Z. Your question seems to imply
an extra level of evaluation, which doesn't occur with GETF.
LISP is wonderful. It lets you say the same thing many ways.
Here are some incantations and what they do (according to Steele
and DEC-20 Common Lisp I'm using):
These change NIL's property list:
(SETQ Z NIL)
(SETF (GET Z :A) :B)
(SETF (GETF (SYMBOL-PLIST 'NIL) :A) :B)
(SETF (GET 'NIL :A) :B)
Note: (SETF (GETF Z :A) :B) gives Z the value (:A :B)
This attempts to change NIL's value:
(SETF (GETF NIL :A) :B)
These retrieve properties from NIL's property list:
(SETQ Z NIL)
(GET Z :A)
(GETF (SYMBOL-PLIST 'NIL) :A)
(GET 'NIL :A)
Note: (GETF Z :A) returns NIL (since Z contains an empty