[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DECLARE SPECIAL Considered Confusing
Date: Mon, 14 Jul 86 16:46 EDT
From: Robert W. Kerns <RWK at YUKON.SCRC.Symbolics.COM>
Date: 11 Jul 86 18:43 PDT
From: Pavel.pa@Xerox.COM
There are six primitive forms in Common Lisp that can both bind
identifiers and carry declarations:
LET LET* FLET LABELS MACROLET LAMBDA
I will describe the scoping rules for declarations in each of these
forms.
You forgot DEFUN and DEFMACRO (and similar top-level definers).
Those, I believe, would be unchanged by your proposal, no?
Pavel was only talking about the -primitive- forms. DEFUN and DEFMACRO
are macros. Presumably DEFUN has the obvious expansion in terms of
LAMBDA, so that it follows the same rules as LAMBDA (which I think
should be analogous to LET*, following the easy-to-remember principle
that the scope of a declaration of something bound by an expression is
the same as the scope of the binding itself). DEFMACRO, also
presumably, has a somewhat more complicated expansion, but would also
adhere to the principle.
Technically speaking, the proposal (with this amendment about the
meaning of LAMBDA as per a later message from Pavel, I think) consitutes
a change in the *meaning* of DEFUN and DEFMACRO, although probably not
in its implementation in terms of LAMBDA. In any case DEFUN should be
consistent with LAMBDA.
Jonathan