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

Issue: PROCLAIM-LEXICAL (Version 7)

   Date: Sat, 24 Sep 88 19:32 EDT
   From: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>

   Test Case:

     #1: (proclaim '(lexical x))
	 (proclaim '(special y))
	 (setq x 1 y 2)
	 (defun tst ()
	   (let ((x 3) (y 4))
	     (locally (declare (special x) (lexical y))
		      (list x y
			    (funcall (let ((x 5) (y 4))
				       #'(lambda () (list x y))))))))
	 (tst) => (1 4 (5 4))

Maybe I'm confused, but I thought this should be (1 2 (5 4)), since
the first reference to y is a lexical reference (LG).  The setq of y
to 2 is global, but the binding of y to 4 is dynamic, and therefore
invisible to a lexical reference.  This is an example of the case
where you stated "some searching may be necessary to find the global
cell in shallow bound implementations [unless dynamic binding has been
forbidden for that variable]" which is also illustrated in the second
example.  Or did you intend that a lexically apparent dynamic binding
is also a lexical binding?  That seems strange to me.  It would imply
that a special binding is not equivalent to a corresponding PROGV, for