From: Ingemar Hulthage
Subject: Help, I'm a loop junkie !
Date: 
Message-ID: <HULTHAGE.95Oct4165807@hollywood.cinenet.net>
I'm hooked on the loop macro, but I have problems with the
incompatibility of different implementations, specifically CLISP and GCL,
especially GCL.  (In all fairness GCL doesn't advertise ANSI, or even
CLtL2, loop but it has something called sloop.)  My point of comparison
is Lucid Lisp, which I found quite useful and which led me into this
habit.

The main problems seem to have to do with the order of initialization
of loop variables and their scope.  Iteration variables (declared by
FOR and AS) and other loop variables (declared by WITH) are not
initialized sequentially as they should (except in constructs with
AND).  Furthermore, loop variables are unbound in INITIALLY and
FINALLY clauses, as if these clauses were outside the scope of these
variables.  CLtL2 isn't crystal clear on the scope of loop variables,
but the INITIALLY and FINALLY clauses don't make any sense if they are
outside the scope of the loop variables.  Since these clauses are only
executed once, they could just as well be placed outside the loop if
the loop variables aren't available.  In my experience (and I have
popped quite a few loops) it's usually easy to do without the
INITIALLY clause, but the FINALLY clause is important.

My question, to the newsgroup, is what other peoples experiences are
and what the ANSI standard says about the behavior of loop.  I'm
loading the mit-loop package into GCL and it's pretty good.  Is there
any other available code that's better ?  I have tried a cmu-loop
package and it doesn't compare favorably with the mit-loop.

And don't tell me to kick the loop habit, I'm to deep into it.

Ingemar Hulthage