]> gitweb.factorcode.org Git - factor.git/commitdiff
hash2: remove since it is now unused.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 12 Oct 2011 22:18:04 +0000 (15:18 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 12 Oct 2011 22:18:04 +0000 (15:18 -0700)
basis/hash2/authors.txt [deleted file]
basis/hash2/hash2-docs.factor [deleted file]
basis/hash2/hash2-tests.factor [deleted file]
basis/hash2/hash2.factor [deleted file]
basis/hash2/summary.txt [deleted file]
basis/hash2/tags.txt [deleted file]

diff --git a/basis/hash2/authors.txt b/basis/hash2/authors.txt
deleted file mode 100644 (file)
index f990dd0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Daniel Ehrenberg
diff --git a/basis/hash2/hash2-docs.factor b/basis/hash2/hash2-docs.factor
deleted file mode 100644 (file)
index 797d838..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-USING: help.syntax help.markup ;
-IN: hash2
-
-ARTICLE: { "hash2" "intro" } "Hash2"
-"The hash2 vocabulary specifies a simple minimal datastructure for hash tables with two integers as keys. These hash tables are fixed size and do not conform to the associative mapping protocol. Words used in creating and manipulating these hash tables include:"
-{ $subsections
-    <hash2>
-    hash2
-    set-hash2
-    alist>hash2
-} ;
-
-HELP: <hash2>
-{ $values { "size" "size of the underlying array" } { "hash2" hash2 } }
-{ $description "Creates a " { $link hash2 } " object with the given size of the underlying array. Initially, the hash2 contains nothing." } ;
-
-HELP: hash2
-{ $values { "a" "first key" } { "b" "second key" } { "hash2" hash2 } { "value/f" "the associated value or f" } }
-{ $description "Looks up the associated value in the hash2 table with the given keys. If a value is found, it is returned, otherwise f is returned. Note that it is significant which order the keys are in." }
-{ $class-description "A hash2 table, with two integers as the key for each value. Hash2 tables are of fixed size and do not conform to the associative mapping protocol." } ;
-
-HELP: set-hash2
-{ $values { "a" "first key" } { "b" "second key" } { "value" "the new value" } { "hash2" hash2 } }
-{ $description "Sets the hash2 at the given key combination to the given value. Note that the order of keys is significant and that this will never grow the hash2 table. Both keys must be integers." } ;
-
-HELP: alist>hash2
-{ $values { "alist" "a sequence of the form " { $snippet "{ { a b value } ... }" } } { "size" "the size of the new underlying array" } { "hash2" hash2 } }
-{ $description "Converts an association list, where the first and second elements of each inner sequence is a key and the third is the value, into a " { $link hash2 } " of the given size. Both keys must be integers." } ;
diff --git a/basis/hash2/hash2-tests.factor b/basis/hash2/hash2-tests.factor
deleted file mode 100644 (file)
index 682680b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-USING: tools.test hash2 kernel ;
-IN: hash2.tests
-
-[ t ] [ 1 2 { 1 2 } 2= ] unit-test
-[ f ] [ 1 3 { 1 2 } 2= ] unit-test
-
-: sample-hash ( -- hash )
-    5 <hash2>
-    [ [ 2 3 "foo" ] dip set-hash2 ] keep
-    [ [ 4 2 "bar" ] dip set-hash2 ] keep
-    [ [ 4 7 "other" ] dip set-hash2 ] keep ;
-
-[ "foo" ] [ 2 3 sample-hash hash2 ] unit-test
-[ "bar" ] [ 4 2 sample-hash hash2 ] unit-test
-[ "other" ] [ 4 7 sample-hash hash2 ] unit-test
-[ f ] [ 4 12 sample-hash hash2 ] unit-test
-[ f ] [ 1 1 sample-hash hash2 ] unit-test
diff --git a/basis/hash2/hash2.factor b/basis/hash2/hash2.factor
deleted file mode 100644 (file)
index aadc0d4..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-! Copyright (C) 2007 Daniel Ehrenberg
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences arrays math vectors locals ;
-IN: hash2
-
-! Little ad-hoc datastructure used to map two numbers
-! to a single value.
-! Created for the NFC mapping table.
-! We could use a hashtable of 2arrays, but that
-! involves creating too many objects.
-! Does not allow duplicate keys.
-
-: hashcode2 ( a b -- hashcode )
-    swap 8 shift + ; inline
-
-: <hash2> ( size -- hash2 ) f <array> ;
-
-: 2= ( a b pair -- ? )
-    first2 [ = ] bi-curry@ bi* and ; inline
-
-: (assoc2) ( a b alist -- {a,b,val} )
-    [ 2= ] with with find nip ; inline
-
-: assoc2 ( a b alist -- value )
-    (assoc2) dup [ third ] when ; inline
-
-:: set-assoc2 ( value a b alist -- alist )
-    { a b value } alist ?push ; inline
-
-: hash2@ ( a b hash2 -- a b bucket hash2 )
-    [ 2dup hashcode2 ] dip [ length mod ] keep ; inline
-
-: hash2 ( a b hash2 -- value/f )
-    hash2@ nth dup [ assoc2 ] [ 3drop f ] if ;
-
-:: set-hash2 ( a b value hash2 -- )
-    value a b hash2 hash2@ [ set-assoc2 ] change-nth ;
-
-: alist>hash2 ( alist size -- hash2 )
-    <hash2> [ over [ first3 ] dip set-hash2 ] reduce ; inline
diff --git a/basis/hash2/summary.txt b/basis/hash2/summary.txt
deleted file mode 100644 (file)
index 307a003..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Special-purpose fixed-size hashtable where keys are pairs of integers
diff --git a/basis/hash2/tags.txt b/basis/hash2/tags.txt
deleted file mode 100644 (file)
index 42d711b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-collections