[Ecls-list] Bug in loop macro

Julian Stecklina der_julian at web.de
Wed Jan 10 20:27:07 UTC 2007


Juan Jose Garcia-Ripoll wrote:
> 2007/1/10, Ralph Campbell <ralphcampbell at sbcglobal.net>:
>> I see examples in Guy Steele's "Common Lisp the Language"
>> the the following should be OK:
> 
> This book is not the appropiate reference. It explains what it is
> commonly called the Cltl1 version of Common Lisp which predates ANSI
> Common Lisp. More precisely, the latter states that FOR and WITH
> statements cannot appear before iteration statements (UNTIL, WHEN,
> etc) and that these must appear before the true actions (DO, NCONC,
> COLLECT, etc)

I think you meant "must" instead of "cannot" as well.

To quote the CLHS (which is not the official ANSI standard either):

http://www.lispworks.com/documentation/HyperSpec/Body/06_ad.htm:
"Termination-test control constructs can be used anywhere within the 
loop body. " (and WHILE is a termination test.)

http://www.lispworks.com/documentation/HyperSpec/Body/06_aba.htm
"The iteration control clauses for, as, and repeat must precede any 
other loop clauses, except initially, with, and named, since they 
establish variable bindings."

What we learn from this is, that it might be better to use iterate. :)

Regards,
Julian




More information about the ecl-devel mailing list