From: Michael Heerdegen <michael_heerdegen@web.de>
To: Roland Winkler <winkler@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: let-bind a varlist only known at run time
Date: Mon, 05 Jun 2017 04:49:47 +0200 [thread overview]
Message-ID: <87efuzup10.fsf@drachen> (raw)
In-Reply-To: <28921.59572.342625.22836@gargle.gargle.HOWL> (Roland Winkler's message of "Sun, 4 Jun 2017 15:43:37 -0500")
"Roland Winkler" <winkler@gnu.org> writes:
> Normally the varlist for the special let form is hardcoded. Is it
> possible to specify the varlist only at runtime?
`cl-progv'?
> On the other hand, I expect that efficiency is not an issue for the
> body appearing in let. So if there is nothing else I could construct
> the complete let-form at runtime and pass it on to `eval'.
FWIW that's what `cl-progv' is doing, more or less. The body is pasted
into a lambda constructed before calling eval so that it can be
compiled. The resulting semantics can be a bit surprising, though; for
example
(let ((x 0))
(cl-progv (list 'x) (list 1)
(funcall (lambda () x))))
yields 0 with lexical-binding on, and
(cl-progv (list 'x) (list 1)
(funcall (lambda () x)))
yields 1.
Michael.
next prev parent reply other threads:[~2017-06-05 2:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-04 20:43 let-bind a varlist only known at run time Roland Winkler
2017-06-05 2:49 ` Michael Heerdegen [this message]
2017-06-05 3:08 ` Roland Winkler
2017-07-12 21:59 ` Michael Heerdegen
2017-07-12 23:09 ` Roland Winkler
2017-06-05 13:44 ` Philipp Stephani
2017-06-05 15:07 ` Roland Winkler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87efuzup10.fsf@drachen \
--to=michael_heerdegen@web.de \
--cc=help-gnu-emacs@gnu.org \
--cc=winkler@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.