]> gitweb.factorcode.org Git - factor.git/commitdiff
linked-assocs: fix new-assoc for linked-assocs
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 19 Jul 2023 16:13:33 +0000 (09:13 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 19 Jul 2023 16:13:33 +0000 (09:13 -0700)
basis/linked-assocs/linked-assocs-tests.factor
basis/linked-assocs/linked-assocs.factor

index cfa7f521cef38b2285f46e5ace791bb378721d82..69c82274a34637229c5d19c3329a95bd91a2e3a9 100644 (file)
@@ -78,3 +78,5 @@ tools.test ;
     { { "a" "b" } { "c" "d" } }
     [ >linked-hash ] [ >linked-hash ] bi =
 ] unit-test
+
+{ LH{ } } [ 0 LH{ { 1 2 } { 3 4 } } new-assoc ] unit-test
index 9fdbd8e675a59b9cfde08f395bd096a326b2327c..8910925a652548a965f5bf064ede48ffd53283ed 100644 (file)
@@ -45,6 +45,9 @@ M: linked-assoc >alist
 M: linked-assoc clear-assoc
     [ assoc>> clear-assoc ] [ dlist>> clear-deque ] bi ;
 
+M: linked-assoc new-assoc
+    assoc>> new-assoc <dlist> linked-assoc boa ;
+
 M: linked-assoc clone
     [ assoc>> clone ] [ dlist>> clone ] bi linked-assoc boa ;