]> gitweb.factorcode.org Git - factor.git/commitdiff
namespaces: remove is-global word.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 14 Aug 2015 00:46:40 +0000 (17:46 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 14 Aug 2015 00:46:40 +0000 (17:46 -0700)
basis/help/help.factor
core/namespaces/namespaces.factor

index 5c88e85a5dbd93fc15dcf4f0064690ae2c72645b..76463e49a2b2c13d8aca9ad9b5846db661523a3b 100644 (file)
@@ -71,7 +71,7 @@ M: word article-title
             [ \ $vocabulary swap 2array , ]
             [ word-help % ]
             [ \ $related swap 2array , ]
-            [ dup is-global [ get-global \ $value swap 2array , ] [ drop ] if ]
+            [ dup global at [ get-global \ $value swap 2array , ] [ drop ] if ]
             [ \ $definition swap 2array , ]
         } cleave
     ] { } make ;
index 5b54de0e6f0fa6b16f70b0155aa2aa21247539ec..44029cdfa17b240b8b097e53215e739e58317f8f 100644 (file)
@@ -22,7 +22,7 @@ TUPLE: global-box value ;
 
 M: global-hashtable at*
     boxes>> at* [
-        { global-box } declare value>> dup
+        { global-box } declare value>> t
     ] [ drop f f ] if ; inline
 
 M: global-hashtable set-at
@@ -33,12 +33,15 @@ M: global-hashtable delete-at
 
 : namestack* ( -- namestack )
     CONTEXT-OBJ-NAMESTACK context-object { vector } declare ; inline
+
 : >n ( namespace -- ) namestack* push ;
+
 : ndrop ( -- ) namestack* pop* ;
 
 PRIVATE>
 
-: global ( -- g ) OBJ-GLOBAL special-object { global-hashtable } declare ; foldable
+: global ( -- g )
+    OBJ-GLOBAL special-object { global-hashtable } declare ; foldable
 
 : namespace ( -- namespace ) namestack* last ; inline
 : get-namestack ( -- namestack ) namestack* clone ;
@@ -47,12 +50,11 @@ PRIVATE>
 : init-namespaces ( -- ) global 1array set-namestack ;
 : get ( variable -- value ) namestack* assoc-stack ; inline
 : set ( value variable -- ) namespace set-at ;
+: change ( variable quot -- ) [ [ get ] keep ] dip dip set ; inline
 : on ( variable -- ) t swap set ; inline
 : off ( variable -- ) f swap set ; inline
-: is-global ( variable -- ? ) global boxes>> key? ; inline
 : get-global ( variable -- value ) global box-at value>> ; inline
 : set-global ( value variable -- ) global set-at ; inline
-: change ( variable quot -- ) [ [ get ] keep ] dip dip set ; inline
 : change-global ( variable quot -- )
     [ [ get-global ] keep ] dip dip set-global ; inline
 : toggle ( variable -- ) [ not ] change ; inline