initialize ( variable quot -- ) (original) (raw)

initialize ( variable quot -- )
Factor handbook » The language » Global variables

Prev: set-global ( value variable -- )
Next: with-global ( quot -- )

Vocabulary
namespaces

Inputs

variable a symbol
quot a quotation

Outputs
None

Word description
If variable does not have a value in the global namespace, calls quot and assigns the result to variable in the global namespace.

Definition

USING: kernel ;

IN: namespaces

: initialize ( variable quot -- )
[ unless* ] curry change-global ; inline