GNU bug report logs -
#43601
27.1; Macroexpansion bug in `push'
Previous Next
Reported by: Sean Devlin <spd <at> toadstyle.org>
Date: Thu, 24 Sep 2020 22:56:01 UTC
Severity: normal
Tags: fixed
Found in version 27.1
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 43601 <at> debbugs.gnu.org (full text, mbox):
Am Fr., 25. Sept. 2020 um 00:56 Uhr schrieb Sean Devlin <spd <at> toadstyle.org>:
>
> Hi folks,
>
> I believe I've found a macroexpansion bug in the `push' macro. Open a
> new instance of Emacs and evaluate the following form in the scratch
> buffer:
>
> (macroexpand '(push (list 'x)
> (cdr my-list)))
>
> The result (with some reformatting) is this:
>
> (let* ((v (list 'x))
> (v my-list))
> (setcdr v
> (cons v
> (cdr v))))
>
> Both values are bound to `v', so the former is shadowed by the latter.
These are different uninterned symbols:
(let ((print-gensym t) (print-circle t))
(print (macroexpand '(push (list 'x) (cdr my-list))))
nil)
⇒ (let* ((#2=#:v (list 'x)) (#1=#:v my-list)) (setcdr #1# (cons #2# (cdr #1#))))
In general, if you see a "weird" expansion like this, bind
print-gensym to non-nil to see the uninterned symbols.
This bug report was last modified 4 years and 317 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.