Subject: bug#76132: Clojure-style auto-gensyms for macros

From: Tassilo Horn <[email-masked]>
Date: Sat, 08 Feb 2025 08:15:55 +0100

Thierry Volpiatto <[email-masked]> writes:

Hi Thierry,

>> you can also write much more concise and convenient
>>
>> (defmacro foo [x y]
>>   `(let [xv# ,x
>>          yv# ,y]
>>      (do-stuff (* xv# xv#) (* yv# yv#))))
>
> Don't we have cl-with-gensyms which is very convenient as well?

Ah, I didn't know.  Well, cl-with-gensyms is basically just a let which
binds the given names to new gensyms.  Then you have to use them as you
did before, e.g., splice them in the expansion `(... ,v1 ,v2).  My
variant infers and replaces the symbols itself by a naming convention
("ending with $" in my example file).

Bye,
Tassilo