I ran across this challenge. Which has this answer.
(loop)
which is cited as having 6 characters. My problem is that when using SBCL and emacs-slime. Doing a macro expansion C-x C-m
leads to
(BLOCK NIL (TAGBODY #:G890 (PROGN) (GO #:G890)))
Which is significantly more than 6 characters. Now the question arises how to count characters in this case. If one allows macros as a valid tool (as loop in SBCL seems to be implemented as a macro) anyone could come up with another macro shortening the loop to 3 characters (or maybe even less).
One might argue that loop
is part of SBCL implementation thus no extra macro is required. But it still feels like cheating using a macro based solution as the 'really' used amount of characters is different.
loop
is guaranteed by specification to behave as a macro: there is a macro function that perform macro expansion and result into another form. A compiler could bypass the macro and do its tricks, but how is this different than a compiler for C? We don't compare machine codes. Of course the implementation of the macro is left to the implementation (e.g. ABCL macroexpands(loop)
as(BLOCK NIL (TAGBODY #:G44 (GO #:G44)))
, which is different from above). I don't understand your concern, sorry. \$\endgroup\$loop
has to behave as a macro. Thus, my point was void. \$\endgroup\$