[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Special Form Question



    Date: Fri, 13 Dec 1985  11:03 EST
    From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>

    We clearly do not require that

    (setf (symbol-function 'foo) (symbol-function 'quote))

    somehow makes foo act like quote.  Nor do we explicitly require this to
    signal an error.  The case that you describe is so perverse that I do
    not think it is worthwhile for those implementations that use something
    like internal FEXPRs in the interpreter to bother checking that they are
    being called in a legitimate way.

    I think the best position to take is the following: Symbols that name
    special forms do have symbol-function slots, just like any other symbol.
    The implementation is allowed, but not required, to put some strange
    object in that slot, and we cannot prevent users from getting their
    hands on this object if it exists.  However, the nature of this object,
    if it exists, is completely unspecified and users cannot count on doing
    anything useful with it.  It is an error to funcall or apply this thing,
    or to stick it in a symbol-function slot of some symbol and then
    evaluate a form with that symbol as the Car.

I agree.  I'd like to propose a clarification about macros.  If a symbol is
the name of a macro, then symbol-function returns an unspecified object that
it is an error to funcall or apply, however sticking that object into the
symbol-function slot of another symbol does make that other symbol name the
same macro.  The alternative would be to say that it's just as illegal for
macros as for special forms.