[Top][All Lists]

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

Re: Elisp lexical-let

From: Ken Raeburn
Subject: Re: Elisp lexical-let
Date: Wed, 22 Jul 2009 16:50:49 -0400

On Jul 22, 2009, at 05:11, Daniel Kraft wrote:
It seemed really hard to me to find at least *basic* information about how the lexbind things works; I did build now an emacs with lexbind from trunk, but so far as I see this is not meant to implement "lexical-let" as the cl package does, but rather allows switching all bindings from dynamic to lexical within one source file.

Oh... I may have seriously misunderstood; sorry about that. That's what comes from not having bothered to look. :-)

In that case, the cl package is probably the thing to look at for now; it is used by a bunch of other things in Emacs. But I do expect lexbind is going to get merged in eventually, so keeping that in mind for the future would be wise too.

And checks with the cl package's implementation of lexical-let give the result, that an inner let does the same as if it was another lexical-let; that is, does not revert to dynamic binding but rather sets only the lexical value.

So, what are the opinions regarding lexical-let as an extension construct? Regarding the behaviour, to me the one described above seems to be a consequence of the implementing with unwind-protect and not necessarily expected -- thus I suggest to implement the version I had in mind, namely that an inner let or argument binding inside a lambda reverts to dynamic binding for that inner scope. This seems more consistent and reasonable to me.

I think you could make an argument for doing it either way. The interesting question would be whether anyone is depending on the behavior from the cl package.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]