[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Elisp lexical-let
From: |
Andy Wingo |
Subject: |
Re: Elisp lexical-let |
Date: |
Fri, 24 Jul 2009 13:42:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) |
Hi Daniel,
On Fri 24 Jul 2009 09:08, Daniel Kraft <address@hidden> writes:
>> It's actually fairly simple, imo. Alpha-equivalence says that
>> (lexical-let ((x a)) x) is the same as (lexical-let ((y a)) y). (Note
>> that this lexical-let corresponds to Scheme's let.) So your program is
>> the same as:
>>
>>> (lexical-let ((y 2))
>>> y ; -> 2
>>> (foo) ; -> 1
>>> (setq y 3)
>>> y ; -> 3
>>> (foo) ; -> 1
>>> (let ((x 4))
>>> x ; -> 4?
>>> (foo) ; -> 4
>>> (setq x 5)
>>> x ; -> 5
>>> (foo) ; -> 5
>>> ) ; end the let
>>> y ; -> 3?
>>> (foo) ; -> 4
>>> )
>>> x ; -> 4
>>> (foo) ; -> 4
>
> Yes of course, my main question was how the inner let is handled, and
> what dynamic values x will attain (the results of (foo)) -- and here's
> this funny stuff that the inner let will be like lexical-let for those
> variables already lexically bound.
Wow, strange. What were they thinking. But if that's the deal, that's
the deal...
Andy
--
http://wingolog.org/
- Re: Elisp lexical-let, (continued)
- Re: Elisp lexical-let, Ken Raeburn, 2009/07/22
- Re: Elisp lexical-let, Daniel Kraft, 2009/07/23
- Re: Elisp lexical-let, Andy Wingo, 2009/07/23
- Re: Elisp lexical-let, Daniel Kraft, 2009/07/24
- Re: Elisp lexical-let, Andy Wingo, 2009/07/23
Re: Elisp lexical-let, Andy Wingo, 2009/07/23