GNU bug report logs -
#76132
Clojure-style auto-gensyms for macros
Previous Next
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 #14 received at 76132 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
>> (defmacro foo [x y]
>> `(let [xv# ,x
>> yv# ,y]
>> (do-stuff (* xv# xv#) (* yv# yv#))))
>>
>> where each symbol ending in # will be replaced
>> by a unique gensymed symbol (per name).
>> Would there be interest in adding something
>> like that to Elisp?
>
> So you could no longer let-bind a variable
> whose name ends in `#', to get a normal let
> binding? (Admittedly, you need to write that
> as `\#' in the source code.)
No, have you looked at the file I attached? You will see the feature is
implemented by a macro itself, so if you don't like it, don't use it.
> Doesn't sound like an improvement, to me.
> A priori, I'm not in favor of limiting the
> names you can use for variables.
>
> That would be especially pernicious with let
> bindings of dynamic ("special") variables.
How many special variables are there ending in # (or actually $ which I
use in my example)?
Bye,
Tassilo
This bug report was last modified 146 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.