]> gitweb.factorcode.org Git - factor.git/blobdiff - core/namespaces/namespaces.factor
Add a toggle word to namespaces and update docs, tests, and usages. Document with...
[factor.git] / core / namespaces / namespaces.factor
index 38c6870cb8b92e417bd64b7f8d6057967dbe2a65..9604be281a18691ff8af31b1b0f26e700103ba4f 100644 (file)
@@ -25,6 +25,7 @@ PRIVATE>
 : set-global ( value variable -- ) global set-at ; inline
 : change ( variable quot -- ) [ [ get ] keep ] dip dip set ; inline
 : change-global ( variable quot -- ) [ global ] dip change-at ; inline
+: toggle ( variable -- ) [ not ] change ; inline
 : +@ ( n variable -- ) [ 0 or + ] change ; inline
 : inc ( variable -- ) 1 swap +@ ; inline
 : dec ( variable -- ) -1 swap +@ ; inline