[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: need for 'dynamical-let'?
From: |
David Kastrup |
Subject: |
Re: need for 'dynamical-let'? |
Date: |
Fri, 24 Jul 2015 06:40:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
"Stephen J. Turnbull" <address@hidden> writes:
> Stephen Leake writes:
>
> > Can we define a macro 'dynamical-let' that would implement this
> > pattern, but with hidden variables?
>
> First, was there a typo in your post? add-to-list normally takes a
> (quoted) symbol. Since the argument isn't quoted, it appears that the
> effect is that you are attempting to add-to-list to the variable (not
> the value!) nil. Assuming that was a typo....
>
> `dynamical-let' is about as ugly as ugly can get, and anyway it
> shouldn't be necessary. The variable is lexically apparent and its
> value is not magical in any way. Your code *should* work.
add-to-list is a function (not a macro) taking a symbol as indicator of
a variable. So lookup happens at run time when the lexical environment
is already gone. No way this can happen lexically.
--
David Kastrup
Re: need for 'dynamical-let'?, Stefan Monnier, 2015/07/24