]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs: fewer namespace lookups for requiring
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Jan 2022 21:42:49 +0000 (13:42 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Jan 2022 21:42:49 +0000 (13:42 -0800)
core/vocabs/vocabs.factor

index a03ae103d918b4a158d066cd9bc6a2b5e2009c01..16cbd5ec652da15171102333a70c2da9dbbb2d9a 100644 (file)
@@ -159,10 +159,10 @@ SYMBOL: requiring
 
 : with-requiring ( quot -- )
     requiring get [
-        call
+        swap call
     ] [
-        HS{ } clone requiring [ call ] with-variable
-    ] if ; inline
+        HS{ } clone dup requiring [ swap call ] with-variable
+    ] if* ; inline
 
 PRIVATE>
 
@@ -180,13 +180,13 @@ M: vocab-link require name>> require ;
 M: string require
     [ ".private" ?tail ] keep swap [ lookup-vocab not ] when [
         [
-            dup requiring get ?adjoin
+            dupd ?adjoin
             [ require-hook get call( name -- ) ] [ drop ] if
         ] with-requiring
     ] [ drop ] if ;
 
 : require-all ( vocabs -- )
-    [ [ require ] each ] with-requiring ;
+    [ require ] each ;
 
 : load-vocab ( name -- vocab )
     [ require ] [ lookup-vocab ] bi ;