 M: f new-assoc drop <hashtable> ; inline
 
 : >hashtable ( assoc -- hashtable )
-    H{ } assoc-clone-like ;
+    [ >alist ] [ assoc-size <hashtable> ] bi [ (rehash) ] keep ;
 
 M: hashtable assoc-like
     drop dup hashtable? [ >hashtable ] unless ; inline

    [ count>> ] [ deleted>> ] bi - ; inline

: rehash ( hash -- )
    dup >alist [ dup clear-assoc ] dip (rehash) ;

M: hashtable set-at ( value key hash -- )
    dup ?grow-hash dupd new-key@ set-nth-pair ;

: associate ( value key -- hash )
    1 <hashtable> [ set-at ] keep ; inline

    2 fixnum+fast [ set-slot ] 2keep
    1 fixnum+fast set-slot ; inline

: (set-at) ( value key hash -- )
    dupd new-key@ set-nth-pair ; inline

: (rehash) ( alist hash -- )
    [ swapd (set-at) ] curry assoc-each ; inline

: hash-large? ( hash -- ? )
    [ count>> 3 fixnum*fast 1 fixnum+fast ]
