[Openmcl-devel] Where is the source of LET* macro

Tim Bradshaw tfb at tfeb.org
Sat Apr 15 02:59:23 PDT 2023


On 14 Apr 2023, at 23:15, Ron Garret <ron at flownet.com> wrote:
> 
> 
> I dunno, I think a perfectly reasonable interpretation is "all the bindings that are VISIBLE at the point where the declaration appears.

Yes, that is a reasonable interpretation as well.

> I think this point of view is particularly defensible in light of the fact that the spec says that declarations appear at the *beginnings* of the *bodies* of certain forms.  Why would a declaration affect a binding not visible in that referenced body?  In other words, declarations don't look "backwards" to "find" bindings, they look *forward* to affect *references* to bindings.

Not always.  (let ((x 1)) (declare (special x)) (foo))  Must affect the semantics of the binding of x even though it cannot possibly see any reference to that binding, since foo, or some function foo calls may (in the scope of an appropriate free declaration for x) refer to that binding, or may in fact (without any declaration at all!) just call boundp, symbol-value or what have you.

This is why there's a distinction between bound declarations and free declarations.

But it's clearly reasonable, as you say, to say that bound declarations affect only the bindings still visible in a form where not all the bindings it establishes are visible in its body.

I think I prefer my original interpretation, where bound declarations affect all bindings made by a form, even shadowed ones,  but I am no longer sure.

--tim


More information about the Openmcl-devel mailing list