From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel@gnu.org
Subject: Re: need for 'dynamical-let'?
Date: Fri, 24 Jul 2015 02:58:09 -0500 [thread overview]
Message-ID: <86oaj2c7hq.fsf@stephe-leake.org> (raw)
In-Reply-To: <87bnf2dvzt.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Fri, 24 Jul 2015 13:23:34 +0900")
"Stephen J. Turnbull" <stephen@xemacs.org> 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.
Yes, that's 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 uses 'symbol-value' on the quoted symbol. As David Kastrup
points out, and as symbol-value doc string says, that does not see
lexical values. So the code will not work.
> Or, perhaps, as Dmitry and the add-to-list docstring suggest, you
> should convert the code to use `push' or `pushnew' instead.
I was working in Emacs 24.3, where the add-to-list doc string does not
mention "push". But the Emacs master doc string does mention it.
> The inconvenience of the busybody compiler macro may be considered a
> "feature" intended to encourage you to modernize your code.
Ok.
--
-- Stephe
next prev parent reply other threads:[~2015-07-24 7:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 20:54 need for 'dynamical-let'? Stephen Leake
2015-07-23 20:58 ` Stephen Leake
2015-07-23 21:03 ` Dmitry Gutov
2015-07-24 8:16 ` Stephen Leake
2015-07-24 9:38 ` Dmitry Gutov
2015-07-24 4:23 ` Stephen J. Turnbull
2015-07-24 4:40 ` David Kastrup
2015-07-24 7:58 ` Stephen Leake [this message]
2015-07-24 16:54 ` Dmitri Paduchikh
2015-07-25 6:41 ` Dmitri Paduchikh
2015-07-25 22:22 ` Stefan Monnier
2015-07-26 0:02 ` Dmitri Paduchikh
2015-07-26 6:51 ` Stefan Monnier
2015-07-26 8:17 ` Dmitri Paduchikh
2015-07-26 15:37 ` raman
2015-07-24 23:32 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86oaj2c7hq.fsf@stephe-leake.org \
--to=stephen_leake@stephe-leake.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).