Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2008-11-12 00:40:11 -06:00
commit 9656ce2e65
2 changed files with 14 additions and 4 deletions

View File

@ -119,7 +119,7 @@ t compile-dependencies? set-global
H{ } clone compiled set
[ queue-compile ] each
compile-queue get compile-loop
compiled get >alist >array
compiled get >alist
] with-scope ;
: enable-compiler ( -- )

View File

@ -128,15 +128,25 @@ M: hashtable set-at ( value key hash -- )
: associate ( value key -- hash )
2 <hashtable> [ set-at ] keep ;
<PRIVATE
: push-unsafe ( elt seq -- )
[ length ] keep
[ underlying>> set-array-nth ]
[ >r 1+ r> (>>length) ]
2bi ; inline
PRIVATE>
M: hashtable >alist
array>> [ length 2/ ] keep V{ } clone [
[ array>> [ length 2/ ] keep ] [ assoc-size <vector> ] bi [
[
>r
>r 1 fixnum-shift-fast r>
[ array-nth ] [ >r 1 fixnum+fast r> array-nth ] 2bi r>
pick tombstone? [ 3drop ] [ [ 2array ] dip push ] if
pick tombstone? [ 3drop ] [ [ 2array ] dip push-unsafe ] if
] 2curry each
] keep ;
] keep { } like ;
M: hashtable clone
(clone) [ clone ] change-array ;