Handbook
Glossary
with-variables ( ns quot -- )
Factor handbook
»
The language
»
Dynamic variables
»
Namespace combinators
Prev:
with-variable ( value key quot -- )
Vocabulary
namespaces
Inputs
ns
an
assoc
quot
a
quotation
Outputs
None
Word description
Calls the quotation in the dynamic scope of
ns
. When variables are looked up by the quotation,
ns
is checked first, and setting variables in the quotation stores them in
ns
.
Definition
USING:
kernel
namespaces.private
;
IN:
namespaces
:
with-variables
( ns quot -- )
swap
>n
call
ndrop
;
inline