MEMO::
Factor documentation > Factor handbook > The language > Lexical variables
Prev:M::
Next:MACRO::


Vocabulary
locals

Syntax
MEMO:: word ( vars... -- outputs... ) body... ;


Word description
Defines a memoized word with named inputs. The word binds its input values to lexical variables from left to right, then executes the body with those bindings in scope.

If any var name is followed by an exclamation point (!), the corresponding new variable is made mutable. See Mutable lexical variables for more information.

Examples
See Examples of lexical variables.

See also
MEMO:

Definition
USING: locals.parser memoize ;

IN: locals

SYNTAX: MEMO:: (::) define-memoized ;