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


        !section  7.5(14)   Nick Gall 85-03-19
        !version  Digital Press 1984
        !topic    Scope and Extent of local function names

    See above comment about the implications of FLET and LABELS not having
    been fully thought out and reflected in the manual.

        I suggest that Common Lisp go all the way, and allow a
        SPECIAL-FUNCTION-NAME declaration that would be analogous to the
        SPECIAL declaration for "ordinary" variables.

        Such a concept would make the idea of
        ordinary-variable/function-name binding and assignment much more

    As I recall this was considered and rejected on the basis that it would
    be confusing and wouldn't give any real increase in expressive power
    (since FUNCALL of a special variable could be used).  I agree with that
    decision, even though our implementation has always had the feature.
    The only place where we use it is in a crock that could just as well be
    done some other way.

I think that a thought out explanation of FLET and LABELS would
allow a SPECIAL-FUNCTION-NAME declaration to be described in
perspicuous manner.

As for its usefulness, I am writing a command processor, and I
wish to prevent the user from typing in forms that might abort
the processor (e.g., (exit), (reset-stack-group), etc.).  FLET
would allow me to establish temporary global function definitions
for these dangerous functions.  The code would be much clearer
than saving the old function definitions, doing defuns (or setfs
of symbol-functions) and then restoring the old definitions.