Stefan Monnier writes: >> I've browsed around for a few common loop implementations and they all >> use gensym (CCL uses gentemp) and descriptive naming: > > gensym is the indeed what is commonly used in Common-Lisp, whereas > make-symbol is what is commonly used in ELisp. Right, but it seems natural that the CL compatibility macros would use gensym since CL does it that way. >> I also found a CHICKEN Scheme egg for CL's loop, and it uses gensym (but >> generic names, unfortunately). > > Does Scheme have make-symbol or something equivalent? The RnRS standards don't specify uninterned symbols, but they mention that some implementations have them. A quick check shows that Guile has make-symbol, and CHICKEN and Racket have equivalents to make-symbol (string->uninterned-symbol). All 3 have gensym. >> If there's a good reason to not use gensym, then that's fine, but if the >> problem is easy enough to work around (perhaps per-expansion counter so >> that it will never realistically hit most-positive-fixnum), then I think >> cl-loop should use it. > > I'd prefer to solve it in the printer, but that's just my opinion. > FWIW, I've found print-gensym to be sufficient. How do you want to solve it in the printer? One way I thought of was to keep a counter similar to cl--gensym-counter, and make a hash table of uninterned symbols with values being the prefix to concat to the end of the print name of the symbol. At this point, though, why not port gensym to ELisp proper and encourage use of gensym? I don't see the use for extra complexity if it's not needed. A seemingly simple option, as mentioned before, is to bind cl--gensym-counter to 0 at the start of cl-loop. That means cl-loop won't increase the global counter, and it fixes the readability of the macro. I attached a sample diff below, which seems to work fine.