(rontolisp) docs
← Syntax and definition

recur

(recur expr...)

Retargets the innermost enclosing loop, named or anonymous fn, defn or letfn entry to the given values and jumps back to its body; the values are evaluated before the jump, in the bindings' order. Each multi-arity clause is its own target, so the count must match the enclosing clause; a wrong count is an error, and recur outside any loop or function is one too. Only a recur in tail position lowers -- anywhere else is an error, and a try between the recur and its target is one too. A recur reaching a variadic ([x & xs]) clause assigns through a worker: the clause splits into a worker taking the rest as an ordinary parameter plus the &rest head for normal calls, so the last recur argument binds the rest itself, like the oracle (an unused variadic keeps its single shape). A lazy-seq body is its own zero-arity target: a recur in its tail position re-runs the thunk itself, so a recur with arguments is an arity error there. Constant-stack by the interpreter's tail calls.