Add iteration on the result of a SQL query.
common-lisp
loop
The macro loop
has been extended to allow iteration over the result of a SQL query. See Loop Extensions in Common SQL in the Common SQL chapter for details.
Notes about the LispWorks implementation of loop
:
repeat
in the list that "must precede any other loop clauses" even though the rest of that section is about for
clauses.
Also, the description of repeat
in 6.1.4 Termination Test Clauses makes repeat
sound more like an interation clause because its form is evaluated once and it does some work before the body rather than being interleaved with other body forms ("If the expression evaluates to 0 or to a negative number, the loop body is not evaluated.").
In LispWorks, the repeat
clause must obey the rules in section 6.1.2.1 Iteration Control. In particular the repeat
clause must precede loop body clauses. To write portable code that uses repeat
with other iteration clauses, we recommend putting the repeat
as the final iteration clause so it can also be regarded as the first of the main-clauses, which makes it match both the syntax as described in the entry for loop and the text of sections section 6.1.2.1 Iteration Control and 6.1.4 Termination Test Clauses.
loop in the Common Lisp HyperSpec
LispWorks® User Guide and Reference Manual - 18 Feb 2025 15:32:15