]> gitweb.factorcode.org Git - factor.git/commitdiff
hashtables: remove 2hashtable (not really used).
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 3 Mar 2016 22:36:48 +0000 (14:36 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 3 Mar 2016 22:38:16 +0000 (14:38 -0800)
core/continuations/continuations-tests.factor
core/destructors/destructors.factor
core/hashtables/hashtables.factor
core/io/pathnames/pathnames-tests.factor

index cc836b45d168257d27dafc12bd5de0b264ae20d2..ce3f36ac3fee50e89aeb4438fec0a6f2419b4312 100644 (file)
@@ -65,9 +65,10 @@ IN: continuations.tests
 SYMBOL: always-counter
 SYMBOL: error-counter
 
-0 always-counter
-0 error-counter 2hashtable
-[
+H{
+    { always-counter 0 }
+    { error-counter 0 }
+} [
 
     [ ] [ always-counter inc ] [ error-counter inc ] cleanup
 
index 2cb758344efcb1d2a0487c52d29828ad98f17856..2196d4f1fbe591cbecca638f9ff424d21ca2ecce 100755 (executable)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007, 2010 Doug Coleman, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors continuations hashtables init kernel namespaces
+USING: accessors assocs continuations init kernel namespaces
 sequences sets ;
 IN: destructors
 
@@ -82,9 +82,9 @@ PRIVATE>
     dup error-destructors get push ; inline
 
 : with-destructors ( quot -- )
-    V{ } clone always-destructors
-    V{ } clone error-destructors
-    2hashtable [
+    H{ } clone
+    V{ } clone always-destructors pick set-at
+    V{ } clone error-destructors pick set-at [
         [ do-always-destructors ]
         [ do-error-destructors ]
         cleanup
index 2c76350194bd94134798db008492bd05096d49f9..0f6ad5919cd749b9a648a84910b2d23162e63dc8 100644 (file)
@@ -150,9 +150,6 @@ M: hashtable set-at
     [ 2dup hash@ set-nth-pair ] keep
     hashtable boa ; inline
 
-: 2hashtable ( value0 key0 value1 key1 -- hash )
-    H{ } clone [ set-at ] keep [ set-at ] keep ; inline
-
 <PRIVATE
 
 : collect-pairs ( hash quot: ( key value -- elt ) -- seq )
index 75574b58dec0bd043e52a87b9bfa843cea763214..8ea5c251b4050133a7e6a99f68917b761dc4ff11 100644 (file)
@@ -57,8 +57,10 @@ IN: io.pathnames.tests
 { } [ 2 [ "touch-twice-test" temp-file touch-file ] times ] unit-test
 
 ! aum's bug
-"." current-directory
-".." "resource-path" 2hashtable [
+H{
+    { current-directory "." }
+    { "resource-path" ".." }
+} [
     [ "../core/bootstrap/stage2.factor" ]
     [ "resource:core/bootstrap/stage2.factor" absolute-path ]
     unit-test