]> gitweb.factorcode.org Git - factor.git/commitdiff
namespaces: Add with-variable-on/off combinators.
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 29 May 2017 17:36:16 +0000 (12:36 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 29 May 2017 17:36:16 +0000 (12:36 -0500)
core/namespaces/namespaces.factor

index 817900416e8e2c829194aaae72fa575607a7712e..2ab8c9a2e751df10c1bde8439117eae2d84acd0a 100644 (file)
@@ -67,4 +67,6 @@ PRIVATE>
 : with-variables ( ns quot -- ) swap >n call ndrop ; inline
 : with-scope ( quot -- ) 5 <hashtable> swap with-variables ; inline
 : with-variable ( value key quot -- ) [ associate ] dip with-variables ; inline
+: with-variable-on ( key quot -- ) [ t swap associate ] dip with-variables ; inline
+: with-variable-off ( key quot -- ) [ f swap associate ] dip with-variables ; inline
 : with-global ( quot -- ) [ global ] dip with-variables ; inline