From: Tassilo Horn <tsdh@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: About `setf' with macro call
Date: Wed, 17 Apr 2013 17:14:48 +0200 [thread overview]
Message-ID: <87vc7lmbo7.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: jwvd2ttdwu1.fsf-monnier+gmane.emacs.help@gnu.org
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> ELISP> (macroexpand '(setf (wrong-order A B) 17))
>> (let*
>> ((v B)
>> (v A))
>> (aset v v 17))
>> --8<---------------cut here---------------end--------------->8---
>
>> Now that explains the let* in the backtrace, but the setf-expansion
>> looks totally wrong! v is set to B (the index) and then overridden by A
>> (the array).
>
> Actually, no: try (setq print-gensym t) to see the full story.
Argh, it's not the first time I've fallen into that trap. It happens so
rarely that at the Nth time I've usually forgotten about the N-1th time
and its explanation. ;-)
So now I've eventually put
(setq print-gensym t
print-circle t)
in my ~/.emacs, so hopefully I won't be caught another time.
Thanks,
Tassilo
next prev parent reply other threads:[~2013-04-17 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 13:21 About `setf' with macro call xfq
2013-04-17 14:06 ` Tassilo Horn
2013-04-17 15:03 ` Stefan Monnier
2013-04-17 15:14 ` Tassilo Horn [this message]
2013-04-20 0:46 ` xfq
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=87vc7lmbo7.fsf@thinkpad.tsdh.de \
--to=tsdh@gnu.org \
--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).