get ( variable -- value ) (original) (raw)

get ( variable -- value )
Factor handbook » The language » Dynamic variables

Next: set ( value variable -- )

Vocabulary
namespaces

Inputs

variable a variable, by convention a symbol

Outputs

value the value or f

Word description
Searches the namestack for a namespace containing the variable, and outputs the associated value. If no such namespace is found, outputs f.

Definition

USING: assocs namespaces.private ;

IN: namespaces

: get ( variable -- value ) (get-namestack) assoc-stack ; inline