[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: symbol-function of non-functions
- To: Randy@ALLEGHENY.SCRC.Symbolics.COM, common-lisp@SAIL.STANFORD.EDU
- Subject: Re: symbol-function of non-functions
- From: David C. Plummer <DCP@QUABBIN.SCRC.Symbolics.COM>
- Date: Fri, 23 Jan 87 09:21 EST
- In-reply-to: The message of 22 Jan 87 15:56 EST from Randy@ALLEGHENY.SCRC.Symbolics.COM
Date: Thu, 22 Jan 87 16:56 EDT
Actually, I've always wondered why SYMBOL-FUNCTION has to signal
an error if the symbol does not have anything in its function cell.
If it is in an attempt to be parallel to SYMBOL-VALUE, then what
about SYMBOL-PLIST and SYMBOL-PACKAGE? SYMBOL-VALUE has to be special
since NIL is an allowable value for a symbol to have, but NIL in
a function cell would mean that there is no function.
Not at all. It means that a further indirection needs to be taken since
NIL is itself a symbol. The indirection looks for the functional value
of NIL, which is presumably unbound, and will then generate an error.
Does all of
this mean that it is incorrect to (SETF (SYMBOL-FUNCTION 'FOO) NIL)
and that one *has* to use FMAKUNBOUND instead?
You can do (SETF (SYMBOL-FUNCTION 'FOO) NIL) and then (FOO) will try to
invoke NIL as a function because of the indirection stated above, and
the fboundness of NIL will determine what will happen. So... to make a
symbol globally funbound, you do have to use FMAKUNOUND.