Fixed and dotted-arity closures use lexical scope, deterministic argument evaluation, and one application dispatcher shared by direct calls and apply.
At a glance
LISPEX
(define (sum first . rest) (apply + first rest))
(sum 1 2 3 4)Result
OUTPUT
10Current guarantees
- Arity mismatch is E302 before the procedure body starts.
- A dotted rest parameter receives a fresh proper list of remaining arguments.
applyaccepts explicit leading arguments plus one final proper list and preserves tail position.
Boundaries
- Applying a non-procedure is E301; an improper final
applylist is a list-domain error. - Host
applyis not used to execute guest closures.