! Copyright (C) 2011 John Benediktsson ! See http://factorcode.org/license.txt for BSD license USING: accessors assocs hashtables hashtables.wrapped kernel math parser sequences vocabs.loader ; IN: hashtables.sequences sequence-wrapper M: sequence-wrapper equal? over sequence-wrapper? [ [ underlying>> ] bi@ sequence= ] [ 2drop f ] if ; inline M: sequence-wrapper hashcode* underlying>> [ sequence-hashcode ] recursive-hashcode ; inline PRIVATE> TUPLE: sequence-hashtable < wrapped-hashtable ; : ( n -- shashtable ) sequence-hashtable boa ; inline M: sequence-hashtable wrap-key drop ; M: sequence-hashtable clone underlying>> clone sequence-hashtable boa ; inline : >sequence-hashtable ( assoc -- shashtable ) [ assoc-size ] keep assoc-union! ; M: sequence-hashtable new-assoc drop ; SYNTAX: SH{ \ } [ >sequence-hashtable ] parse-literal ; { "hashtables.sequences" "prettyprint" } "hashtables.sequences.prettyprint" require-when