Define a way for macros to wrap a :(CLHS LOOP) around the body without affecting :(CLHS LOOP-FINISH) forms within it. This could be done by defining a new :(CLHS LOOP) keyword FINISH-NAME. Then, (loop ... do (loop finish-name foo ... do (loop-finish))) would finish the outer loop directly. To finish just the inner loop, you'd have to use (loop-finish foo). Macros would use gensyms.
Other possible syntaxes include (loop using (loop-finish foo) ...), which puns on for-as-hash; (loop unfinishable ...), which would be entirely invisible to LOOP-FINISH; and (loop fully named foo ...), which would require both (:(CLHS return-from) foo ...) and (loop-finish foo).
Would extending :(CLHS LOOP-FINISH) to take the loop name as an argument be sufficient (exit from the innermost loop with the given name)? --Nikodemus
Not quite. Users of macros would often omit the argument of :(CLHS LOOP-FINISH), for the sake of clarity or compatibility with current CL. Implementors of macros would not be able to handle such cases transparently. If :(CLHS LOOP) is extended too, then only macro implementors need be careful, like they already are with names of variables; users can ignore the whole issue. -_(Kalle Olavi Niemitalo)
I don't understand the need for this. However, :(CLHS LOOP) already has a NAMED clause that could be used for :(CLHS LOOP-FINISH). It would overload its meaning, but it would reduce the number of changes needed. - _(Marco Antoniotti)>