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

Interchange of interest

- - - - Begin forwarded messages - - - -
Received: from CMU-CS-PT by CMU-CS-A; 19 Dec 83 21:15:42 EST
Received: from MIT-MC by CMU-CS-PT; 19 Dec 83 21:01:42 EST
Date: Tue, 20 Dec 1983 01:14:00 -0000
From: Glenn S. Burke <GSB @ MIT-MC>
Subject: Special declarations
To: Guy.Steele @ CMU-CS-A

	  (LET ((A A))
is rewritten as
	(defun foo (a)
	  ((lambda (a)
	      (declare (special a))
is it equivalent?  If it is, then there is the interesting consequence
that it is not equivalent to
   (defun foo (a)
     (funcall #'(lambda (a) (declare (special a)) ...) a))

If it is not, as i presume is the case, perhaps more effort should
have been put in to emphasize the non-equivalence of LET with
its "obvious" macro expansion, which is something which people (and
compilers!) that think they know LET will blow.

I can understand the reasoning that leads up to all of this, i guess
my problem is that it leaves me feeling uncomfortable.  About four
years ago i started writing the front-end part for a lisp compiler,
and one thing i couldn't decide how to handle was declaration scoping
with sequential binding (let*, &optional).
     - - - - - - - - -
Date: Thu, 22 Dec 1983 01:42:00 -0000
From: Guy.Steele@CMU-CS-A
To: Glenn S. Burke <GSB@MIT-MC>
Subject: Re: Special declarations
In-Reply-To: "Glenn S. Burke's message of 19 Dec 83 21:14-EST"

I feel that the current declaration semantics are a bit awkward, too,
but I think it's the best we can do.  You are quite correct that
	(LET ((A A)) (DECLARE (SPECIAL A)) ...)
are not equivalent, because the A in the initialization form is
special in the first case, but the A that is the argument (not the
formal parameter) to the lambda expression is not special in the
second case.
Indeed, the interpretation of a LET containing declarations is not
trivial, and that is the main reason why it is documented as a
special form, not as a macro, in Common LISP.
- - - - End forwarded messages - - - -