]> gitweb.factorcode.org Git - factor.git/commitdiff
hashtables.wrapped: INSTANCE: assoc and support new-assoc.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 17 Jul 2012 22:50:03 +0000 (15:50 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 17 Jul 2012 22:50:03 +0000 (15:50 -0700)
basis/hashtables/identity/identity.factor
basis/hashtables/sequences/sequences.factor
basis/hashtables/wrapped/wrapped.factor

index e8dfd509af53c263df6d1238964aad97c2e2a095..f7601ebd7bb14bf7cd6d165d01b067495f90f124 100644 (file)
@@ -34,6 +34,8 @@ M: identity-hashtable clone
 M: identity-hashtable assoc-like\r
     drop dup identity-hashtable? [ >identity-hashtable ] unless ; inline\r
 \r
+M: identity-hashtable new-assoc drop <identity-hashtable> ;\r
+\r
 SYNTAX: IH{ \ } [ >identity-hashtable ] parse-literal ;\r
 \r
 { "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when\r
index fed14608ed5225c77794fa5b2e314af646ecff6d..907d97b7c4190406bf66b545a0183661789a1a9e 100644 (file)
@@ -31,6 +31,8 @@ M: sequence-hashtable clone
 : >sequence-hashtable ( assoc -- shashtable )
     [ assoc-size <sequence-hashtable> ] keep assoc-union! ;
 
+M: sequence-hashtable new-assoc drop <sequence-hashtable> ;
+
 SYNTAX: SH{ \ } [ >sequence-hashtable ] parse-literal ;
 
 { "hashtables.sequences" "prettyprint" } "hashtables.sequences.prettyprint" require-when
index 8c3b47da70910eb27c363ee52c145e1fa1422a7d..82d76c44bdc0aa4779cfaad302e54c58386593f1 100644 (file)
@@ -42,4 +42,6 @@ M: wrapped-hashtable >alist
 M: wrapped-hashtable equal?
     over wrapped-hashtable? [ [ underlying>> ] bi@ = ] [ 2drop f ] if ;
 
+INSTANCE: wrapped-hashtable assoc
+
 { "hashtables.wrapped" "prettyprint" } "hashtables.wrapped.prettyprint" require-when