6.1. The LOOP Facility
Prev | Chapter 6. Iteration | Next

## 6.1. The LOOP Facility [sec_6-1]

### 6.1.1. Iteration variables in the loop epilogue

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.

### 6.1.2. Backward Compatibility

There have been some tightening in the `LOOP` syntax between [CLtL2] and [ANSI CL standard], 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.45 | Last modified: 2008-05-14

Enter your search termsSubmit search form
Webclisp.cons.orgclisp.podval.orgwww.lisp.org

Prev | Up | Next
Chapter 6. Iteration | Home | 6.2. Miscellaneous