GNU bug report logs - #76132
Clojure-style auto-gensyms for macros

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tsdh <at> gnu.org>

Date: Fri, 7 Feb 2025 21:13:02 UTC

Severity: wishlist

Tags: patch

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #64 received at 76132 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 76132 <at> debbugs.gnu.org, Richard Stallman <rms <at> gnu.org>
Subject: Re: bug#76132: Clojure-style auto-gensyms for macros
Date: Wed, 12 Feb 2025 08:55:51 -0500
>   (equal (macroexpand '(cl-with-gensyms (x)
>                          `(+ ,x ,x)))
>          (macroexpand '(cl-with-gensyms (x)
>                          `(+ ,x ,x))))
>   ;;=> t

That doesn't test what you think it does because

    (macroexpand '(cl-with-gensyms (x) `(+ ,x ,x)))

does not return any uninterned symbols.  It returns the code which *when
executed* will generate a new uninterned symbol.  Try

    (equal (eval (macroexpand '(cl-with-gensyms (x)
                                 `(+ ,x ,x))))
           (eval (macroexpand '(cl-with-gensyms (x)
                                 `(+ ,x ,x)))))


- Stefan





This bug report was last modified 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.