Next: , Previous: , Up: iklib syntaxes loops   [Index]


6.8.7.7 Iterating with the dotimes syntax

Syntax: dotimes (?var ?count-expr) ?body0 ?body
Syntax: dotimes (?var ?count-expr ?result-expr) ?body0 ?body

Iterate over exact integers from zero to the return value of ?count-expr, which must return a non–negative exact integer; at each iteration: the next integer is bound to ?var; evaluate the ?body forms in the region of the binding.

If ?result-expr is present: it is evaluated, in the region of ?var, to produce the return values. If ?result-expr is not present: the syntax use returns no values.

This syntax meant to be similar to the Common Lisp syntax of the same name.