GNU bug report logs -
#27177
26.0.50: Macroexpanding cl-loop and friends (make-symbol usage)
Previous Next
Reported by: Alex <agrambot <at> gmail.com>
Date: Wed, 31 May 2017 23:25:02 UTC
Severity: minor
Found in version 26.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
>> Stefan, why did you make the switch? Using cl-gensym would help a ton
>> with readability of cl-loop's macroexpansion.
>
> I don't consider human-readability of the result to be something that
> a macro should have to pay attention to.
I can understand that when talking about smaller macros, but loop is a
fairly complex macro, so I believe human-readability is a desirable
trait to have if feasible. It would help with debugging and overall
understanding of cl-loop.
I've browsed around for a few common loop implementations and they all
use gensym (CCL uses gentemp) and descriptive naming:
SBCL: https://github.com/sbcl/sbcl/blob/master/src/code/loop.lisp
CLISP: https://sourceforge.net/p/clisp/clisp/ci/default/tree/src/loop.lisp
CCL: https://github.com/Clozure/ccl/blob/master/library/loop.lisp
ABCL (admittedly they adapted it from SBCL):
http://abcl.org/trac/browser/trunk/abcl/src/org/armedbear/lisp/loop.lisp
I also found a CHICKEN Scheme egg for CL's loop, and it uses gensym (but
generic names, unfortunately).
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.
This bug report was last modified 4 years and 351 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.