Basis | Lexical Scope |
a.k.a. unnamed functions
closure-param ::= spec parameters then closure ::= { [closure-param] statements }
The parameter specification can be skipped, in which case the parameters can be refered to as @1..@n, and their types will be derived from the environment.
If you use the parameter specification, you can use @ as a generic type and the type will be derived (as in the case of no parameter specification) from the environment.
Nota Bene: if the environment has several matches (in case of overloading), then you must specify enough types to limit to matching set to one.
Closures do not support: return, yield, or fail.
Closures can use variables from their lexical scope. If it does, then a closure will result in the creation of one (1) extra code block per invocation of the closure definition: