dec
change
change-global
+ toggle
} ;
ARTICLE: "namespaces-global" "Global variables"
get-global
set-global
initialize
+ with-global
} ;
ARTICLE: "namespaces.private" "Namespace implementation details"
{ $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." }