[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DECLARE SPECIAL Considered Confusing
Date: Mon, 7 Jul 86 10:03 EDT
From: "David C. Plummer" <DCP@arpa.scrc-quabbin>
Subject: DECLARE SPECIAL Considered Confusing
Date: 5 Jul 86 16:54 PDT
From: Pavel.pa@Xerox.COM
What do people think? It would appear that some implementations already
work this way.
I agree. Consider LET to be a macro that turns into LAMBDA:
(let ((foo (1+ foo)))
(declare (special foo))
foo)
=> ((lambda (foo)
(declare (special foo))
foo)
(1+ foo))
[I think this is what MacLisp actually did (does?).] The scoping here
is clear: the foo in (1+ foo) is outside the scope of the declaration.
If the SPECIAL declaration is to apply to the init forms, LET can be
a macro that turns into two lambdas:
(let ((foo (1+ foo))) (declare (special foo)) foo)
=> ((lambda ()
(declare (special foo))
((lambda (foo) foo) (declare (special foo)) (1+ foo))))
Some implementations do work this way.