! Copyright (C) 2004, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: arrays assocs continuations debugger generic hashtables
-init io io.files kernel kernel.private make math memory
-namespaces parser parser.notes prettyprint sequences splitting
-system vectors vocabs vocabs.loader words destructors ;
+USING: arrays assocs continuations debugger destructors generic
+hash-sets hashtables init io io.files kernel kernel.private
+make math memory namespaces parser parser.notes prettyprint
+sequences splitting system vectors vocabs vocabs.loader words ;
QUALIFIED: bootstrap.image.private
+QUALIFIED: hashtables
+QUALIFIED: hash-sets
IN: bootstrap.stage1
"Bootstrap stage 1..." print flush
[
! Rehash hashtables first, since bootstrap.image creates
! them using the host image's hashing algorithms.
- [ hashtable? ] instances [ rehash ] each
+ [ hashtable? ] instances [ hashtables:rehash ] each
+ [ hash-set? ] instances [ hash-sets:rehash ] each
boot
] %
M: hash-set cardinality ( hash -- n )
[ count>> ] [ deleted>> ] bi - ; inline
+: rehash ( hash -- )
+ [ members ] [ clear-set ] [ (rehash) ] tri ;
+
M: hash-set adjoin ( key hash -- )
dup ?grow-hash (adjoin) ;