From: Stephen Berman <stephen.berman@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: A question about macro bindings in cl-lib
Date: Wed, 24 Apr 2013 10:56:02 +0200 [thread overview]
Message-ID: <87haiwnw7x.fsf@rosalinde.fritz.box> (raw)
In-Reply-To: CAAF+z6GqtdJhpgXrHT4rTRtUo+wmscufzbA6UyV37RQCDKTY4Q@mail.gmail.com
On Wed, 24 Apr 2013 16:17:42 +0800 Xue Fuqiao <xfq.free@gmail.com> wrote:
> In (info "(cl) Macro Bindings"):
>
> (cl-defmacro my-dolist ((x list) &rest body)
> (let ((var (cl-gensym)))
> (list 'cl-loop 'for var 'on list 'do
> (cl-list* 'cl-symbol-macrolet
> (list (list x (list 'car var)))
> body))))
> (setq mylist '(1 2 3 4))
> (my-dolist (x mylist) (cl-incf x))
> mylist
> => (2 3 4 5)
>
> The `my-dolist' call shown here expands to
>
> (cl-loop for G1234 on mylist do
> (cl-symbol-macrolet ((x (car G1234)))
> (cl-incf x)))
>
> I understand what this macro does, but what does "G1234" mean here?
Does the doc string of cl-gensym answer the question for you? If not,
can you make the question more specific?
Steve Berman
next prev parent reply other threads:[~2013-04-24 8:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 8:17 A question about macro bindings in cl-lib Xue Fuqiao
2013-04-24 8:56 ` Stephen Berman [this message]
2013-04-24 13:33 ` Stefan Monnier
2013-04-24 22:23 ` Xue Fuqiao
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=87haiwnw7x.fsf@rosalinde.fritz.box \
--to=stephen.berman@gmx.net \
--cc=help-gnu-emacs@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.
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).