]> gitweb.factorcode.org Git - factor.git/blobdiff - core/namespaces/namespaces-docs.factor
Add a toggle word to namespaces and update docs, tests, and usages. Document with...
[factor.git] / core / namespaces / namespaces-docs.factor
index 05a72c602583ba669031d83b98100d7c0215d5ac..cebd5ba59ced0e09d47fcc49bc473254f505297d 100644 (file)
@@ -19,6 +19,7 @@ ARTICLE: "namespaces-change" "Changing variable values"
     dec
     change
     change-global
+    toggle
 } ;
 
 ARTICLE: "namespaces-global" "Global variables"
@@ -28,6 +29,7 @@ ARTICLE: "namespaces-global" "Global variables"
     get-global
     set-global
     initialize
+    with-global
 } ;
 
 ARTICLE: "namespaces.private" "Namespace implementation details"
@@ -93,6 +95,18 @@ HELP: change-global
 { $description "Applies the quotation to the old value of the global variable, and assigns the resulting value to the global variable." }
 { $side-effects "variable" } ;
 
+HELP: toggle
+{ $values
+    { "variable" "a variable, by convention a symbol" }    
+}
+{ $description "Changes the boolean value of a variable to its opposite." } ;
+
+HELP: with-global
+{ $values
+    { "quot" quotation }    
+}
+{ $description "Runs the quotation in the global namespace." } ;
+
 HELP: +@
 { $values { "n" "a number" } { "variable" "a variable, by convention a symbol" } }
 { $description "Adds " { $snippet "n" } " to the value of the variable. A variable value of " { $link f } " is interpreted as being zero." }