]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDaniel Ehrenberg <littledan@Macintosh-122.local>
Tue, 18 Aug 2009 17:49:29 +0000 (12:49 -0500)
committerDaniel Ehrenberg <littledan@Macintosh-122.local>
Tue, 18 Aug 2009 17:49:29 +0000 (12:49 -0500)
basis/biassocs/biassocs-tests.factor
basis/biassocs/biassocs.factor

index 2ef54441e14f838a0eaac7a1dd92e95e50cdfb81..af10eb18e495d7653ba2137a302586aaf74edf3c 100644 (file)
@@ -1,4 +1,4 @@
-USING: biassocs assocs namespaces tools.test ;
+USING: biassocs assocs namespaces tools.test hashtables kernel ;
 IN: biassocs.tests
 
 <bihash> "h" set
@@ -30,3 +30,13 @@ H{ { "a" "A" } { "b" "B" } } "a" set
 [ "A" ] [ "a" "b" get at ] unit-test
 
 [ "a" ] [ "A" "b" get value-at ] unit-test
+
+[ ] [ H{ { 1 2 } } >biassoc "h" set ] unit-test
+
+[ ] [ "h" get clone "g" set ] unit-test
+
+[ ] [ 3 4 "g" get set-at ] unit-test
+
+[ H{ { 1 2 } } ] [ "h" get >hashtable ] unit-test
+
+[ H{ { 1 2 } { 4 3 } } ] [ "g" get >hashtable ] unit-test
index 5956589ba56eefce12c97af5c7276426bff61652..7daa478f544f0d14a1143696d70312e746054b64 100644 (file)
@@ -43,4 +43,7 @@ M: biassoc new-assoc
 INSTANCE: biassoc assoc
 
 : >biassoc ( assoc -- biassoc )
-    T{ biassoc } assoc-clone-like ;
\ No newline at end of file
+    T{ biassoc } assoc-clone-like ;
+
+M: biassoc clone
+    [ from>> ] [ to>> ] bi [ clone ] bi@ biassoc boa ;