]> gitweb.factorcode.org Git - factor.git/blobdiff - core/hashtables/hashtables.factor
combinators: move recursive-hashcode to kernel vocab.
[factor.git] / core / hashtables / hashtables.factor
index 9cda95da6a20535e8ce7d9146f724acd1721fb49..7d072f93a391a79d100b87f1dd7f3e786d238f86 100644 (file)
@@ -171,6 +171,12 @@ M: hashtable clone
 M: hashtable equal?
     over hashtable? [ assoc= ] [ 2drop f ] if ;
 
+M: hashtable hashcode*
+    [
+        dup assoc-size 1 eq?
+        [ assoc-hashcode ] [ nip assoc-size ] if
+    ] recursive-hashcode ;
+
 ! Default method
 M: assoc new-assoc drop <hashtable> ; inline