Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 98:13:25 |
Calls: | 290 |
Files: | 905 |
Messages: | 76,483 |
Pascal Bourguignon <spam@thalassa.informatimago.com> writes:
Peter Seibel <peter@....com> writes:
Pascal Bourguignon <spam@thalassa.informatimago.com> writes:
rpw3@rpw3.org (Rob Warnock) writes:
> (loop for i below 4
for j below 4
finally (return (list i j)))
(4 3)
>
Oh. Duh.
LOOP is definitely one of the parts of CL where you learn something new >> >> every day... ;-} ;-}
Actually, the variables i and j could very well not be available in
the finally clause.
How do you figure that? Why would the finally clause be any different
from any of the other clauses?
Note how clisp returns a conforming but differnet result too:
[193]> (loop for i below 4
for j below 4
finally (return (list i j)))
(4 4)
Hmmm. I'm not sure I buy that that's conforming. Given that LOOP
provides AND for specifying parallel stepping, why should CLISP's
behavior here be considered correct?
Because the loop variables don't have to be available in the finally clause! If they're available, their value is unspecified.
And why do you say they don't have to be available in the finally
clause? Granted I can't see anything in the spec that *specifically*
says they have to be but I can't see anything that specifically says
they have to available *anywhere*. Why should the finally clause be
any different from any other LOOP clause?