[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About `setf' with macro call
From: |
xfq |
Subject: |
Re: About `setf' with macro call |
Date: |
Sat, 20 Apr 2013 08:46:49 +0800 |
Ah, I see. Thanks you, Stefan and Tassilo.
On Wed, Apr 17, 2013 at 11:14 PM, Tassilo Horn <tsdh@gnu.org> wrote:
> 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
>
>
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/