On Sun, 12 Jun 2005, Nicolas Neuss wrote:
>>>> (loop with m = 5
>>>> initially (setq m 3)
>>>> for i below m do (princ i))
>>>>
>>>> should print only "012", no?
> second one is simply false. Look at 6.1.1.6 (LOOP: Order of Execution).
> This is clearly not an example. The problem is that it is somewhat vague.
>From 6.1.7.2:
"The initially construct causes the supplied compound-forms to be
evaluated in the loop prologue, which precedes all loop code except for
initial settings supplied by constructs with, for, or as. The code for any
initially clauses is executed in the order in which the clauses appeared
in the loop."
Not vague at all. ("012" is right.) SBCL is wrong here too.
I suspect one reason some people dislike loop is that very few
implementation get all of it right, making things more confusing then
they really are.
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."