The standard is unambiguous in that the iteration variables do
still exist in the FINALLY
clause, but not as to what values
these variables might have.
Therefore the code which relies on the values of such variables, e.g.,
(loop for x on y finally (return x))
is inherently non-portable across Common Lisp implementations, and should be avoided.
There have been some tightening in the LOOP
syntax between
[CLtL2] and [ANSI CL], e.g., the following form is legal in the
former but not the latter:
(loop initially for i from 1 to 5 do (print i) finally return i)
When CUSTOM:*LOOP-ANSI*
is NIL
, such forms are still
accepted in CLISP but elicit a warning at macro-expansion time.
When CUSTOM:*LOOP-ANSI*
is non-NIL
, an ERROR
is SIGNAL
ed.
These notes document CLISP version 2.41 | Last modified: 2006-10-13 |