diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 36873094d1..2ed3e37e09 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,11 +1,5 @@ + 0.80: -- flip-branches optimizer not working -- prettyprint: - - { V{ T{ literal T{ value f f G:110886 } f } T{ value - f f G:110887 - } } } - intrinsic char-slot set-char-slot for x86 - closing ui does not stop timers - adding/removing timers automatically for animated gadgets @@ -18,8 +12,6 @@ - what about tasks and timers between image restarts - double hash -- empty key change -- if hash is full and we change existing key, it should not grow + ui: diff --git a/library/collections/hashtables.factor b/library/collections/hashtables.factor index f24e39e76b..d3e94b75f3 100644 --- a/library/collections/hashtables.factor +++ b/library/collections/hashtables.factor @@ -41,7 +41,7 @@ TUPLE: tombstone ; >r >r [ key@ ] 2keep pick -1 > r> r> if ; inline : ( n -- array ) - 1+ 4 * ((empty)) >array ; + 4 * ((empty)) >array ; : reset-hash ( n hash -- ) swap over set-underlying @@ -154,15 +154,16 @@ IN: hashtables : hash-size ( hash -- n ) dup hash-count swap hash-deleted - ; : grow-hash ( hash -- ) - [ underlying ] keep - [ >r length r> reset-hash ] 2keep - swap [ swap pick (set-hash) ] each-pair drop ; + [ dup underlying swap hash-size 1+ ] keep + [ reset-hash ] keep swap [ swap pick (set-hash) ] each-pair + drop ; : ?grow-hash ( hash -- ) - dup hash-count 1+ 4 * over underlying length > + dup hash-count 2 + 2 * over underlying length > [ dup grow-hash ] when drop ; -: set-hash ( value key hash -- ) dup ?grow-hash (set-hash) ; +: set-hash ( value key hash -- ) + [ (set-hash) ] keep ?grow-hash ; : hash-keys ( hash -- keys ) 0 swap hash>seq ; diff --git a/library/inference/optimizer.factor b/library/inference/optimizer.factor index e891bc6cf8..02951a427d 100644 --- a/library/inference/optimizer.factor +++ b/library/inference/optimizer.factor @@ -65,8 +65,8 @@ M: #shuffle optimize-node* ( node -- node/t ) compose-shuffle-nodes ] [ drop [ - dup node-in-d over node-out-d = - [ dup node-in-r swap node-out-r = ] [ drop f ] if + dup node-in-d over node-out-d sequence= + >r dup node-in-r swap node-out-r sequence= r> and ] prune-if ] if ; diff --git a/library/syntax/prettyprint.factor b/library/syntax/prettyprint.factor index d4827b61a5..194e9b39d7 100644 --- a/library/syntax/prettyprint.factor +++ b/library/syntax/prettyprint.factor @@ -298,7 +298,7 @@ M: tuple pprint* ( tuple -- ) [ \ T{ pprint* tuple>array dup first pprint* - +