Local is the binding form that Donkey directly interprets. Donkey does not directly support the Scheme binding forms let , let* , and letrec . letrec is subsumed by local , and let and let* are transformed into equivalent lambda applications.
(local (defs) body ...) (local definitions)
Syntax: defs must be a sequence of definitions, i.e., either definitions of the shape (define var exp) where var is a variable and exp is an arbitrary expression, or of the shape (define-structure (var1 var2 ...)).
Semantics: The definitions are evaluated as if they were global except that their scope is only the expression.
Pragmatics: local is the primary tool to organize programs. If some function is only useful as an auxiliary function for some other function, it should be hidden using local. If some sequence of definitions depend on the parameter to a function, local is the feature to be used.
![]()