bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43601: 27.1; Macroexpansion bug in `push'


From: Philipp Stephani
Subject: bug#43601: 27.1; Macroexpansion bug in `push'
Date: Fri, 25 Sep 2020 11:35:35 +0200

Am Fr., 25. Sept. 2020 um 00:56 Uhr schrieb Sean Devlin <spd@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]