! This would be much better if live-set was a real set
: kill-defs ( live-set insn -- )
defs-vregs [ ?leader ] map
- '[ drop ?leader _ in? not ] assoc-filter! drop ; inline
+ '[ drop ?leader _ in? ] assoc-reject! drop ; inline
: gen-uses ( live-set insn -- )
uses-vregs [ swap conjoin ] with each ; inline
! For every vreg, compute preferred representation, that minimizes costs.
: minimize-costs ( costs -- representations )
- [ nip assoc-empty? not ] assoc-filter
+ [ nip assoc-empty? ] assoc-reject
[ >alist alist-min first ] assoc-map ;
: compute-representations ( cfg -- )
H{ } clone replaces set ;
: remove-redundant-replaces ( replaces -- replaces' )
- [ [ loc>vreg ] dip = not ] assoc-filter ;
+ [ [ loc>vreg ] dip = ] assoc-reject ;
: end-local-analysis ( basic-block -- )
[
: outdated-conditional-usages ( set -- assocs )
members H{ } clone '[
conditional-dependencies-of
- [ drop _ dependencies-satisfied? not ] assoc-filter
+ [ drop _ dependencies-satisfied? ] assoc-reject
] map ;
: generic-call-sites-of ( word -- assoc )
[
event-stream-callbacks
- [ [ drop expired? not ] assoc-filter H{ } assoc-like ] change-global
+ [ [ drop expired? ] assoc-reject H{ } assoc-like ] change-global
] "core-foundation" add-startup-hook
: add-event-source-callback ( quot -- id )
((get-user)) ;
: strip-hash ( hash1 -- hash2 )
- [ drop first CHAR: _ = not ] assoc-filter ;
+ [ drop first CHAR: _ = ] assoc-reject ;
: at-or-k ( key hash -- newkey )
dupd at [ nip ] when* ;
: make-specializer ( specs -- quot )
dup length iota <reversed>
[ (picker) 2array ] 2map
- [ drop object eq? not ] assoc-filter
+ [ drop object eq? ] assoc-reject
[ [ t ] ] [
[ swap specializer-predicate append ] { } assoc>map
[ ] [ swap [ f ] \ if 3array append [ ] like ] map-reduce
[ drop chloe-name? ] assoc-filter ;
: non-chloe-attrs-only ( assoc -- assoc' )
- [ drop chloe-name? not ] assoc-filter ;
+ [ drop chloe-name? ] assoc-reject ;
: chloe-tag? ( tag -- ? )
dup xml? [ body>> ] when
bi* ;
: compile-component-attrs ( tag class -- )
- [ attrs>> [ drop main>> "name" = not ] assoc-filter ] dip
+ [ attrs>> [ drop main>> "name" = ] assoc-reject ] dip
[ all-slots swap '[ name>> _ at compile-attr ] each ]
[ [ boa ] [code-with] ]
bi ;
: fp-env-register ( -- register ) (fp-env-registers) first ;
:: mask> ( bits assoc -- symbols )
- assoc [| k v | bits v mask zero? not ] assoc-filter keys ;
+ assoc [| k v | bits v mask zero? ] assoc-reject keys ;
: >mask ( symbols assoc -- bits )
over empty?
[ 2drop 0 ]
] if ; inline
: filter-tuple-assoc ( slot,value -- name,value )
- [ [ initial>> ] dip = not ] assoc-filter
+ [ [ initial>> ] dip = ] assoc-reject
[ [ name>> ] dip ] assoc-map ;
: tuple>assoc ( tuple -- assoc )
dup new-transitions '[
[
_ swap '[ _ get-transitions ] assoc-map
- [ nip empty? not ] assoc-filter
+ [ nip empty? ] assoc-reject
] preserving-epsilon
] assoc-map
] change-transitions ;
: remove-duplicates ( seq -- seq' )
#! Remove _consecutive_ duplicates (unlike prune which removes
#! all duplicates).
- [ 2 <clumps> [ = not ] assoc-filter values ] [ first ] bi prefix ;
+ [ 2 <clumps> [ = ] assoc-reject values ] [ first ] bi prefix ;
: first>upper ( seq -- seq' ) 1 head >upper ;
: trim-first ( seq -- seq' ) dup first [ = ] curry trim-head ;
M: word coverage ( word -- seq )
"coverage" word-prop >alist
- [ drop executed?>> not ] assoc-filter values ;
+ [ drop executed?>> ] assoc-reject values ;
GENERIC: coverage. ( object -- )
"Stripping word properties" show
swap '[
[
- [ drop _ member? not ] assoc-filter sift-values
+ [ drop _ member? ] assoc-reject sift-values
>alist f like
] change-props drop
] each ;
dup array? [
[
2 group
- [ drop _ key? not ] assoc-filter
+ [ drop _ key? ] assoc-reject
concat
] map
] when
stripped-globals :> to-strip
cleared-globals :> to-clear
global boxes>>
- [ drop to-strip strip-global? not ] assoc-filter!
+ [ drop to-strip strip-global? ] assoc-reject!
[
[
swap to-clear clear-global?
[ total-time>> ] same? ;
: trim-flat ( root-node -- root-node' )
- dup '[ [ nip _ redundant-flat-node? not ] assoc-filter ] change-children ;
+ dup '[ [ nip _ redundant-flat-node? ] assoc-reject ] change-children ;
PRIVATE>
] change-commands drop multiline-editor update-gestures
"interactor" interactor get-command-at [
- [ drop T{ key-down f { C+ } "k" } = not ] assoc-filter
+ [ drop T{ key-down f { C+ } "k" } = ] assoc-reject
] change-commands drop interactor update-gestures"""
}
$nl
: process-combining ( data -- hash )
3 swap (process-data)
[ string>number ] assoc-map
- [ nip zero? not ] assoc-filter
+ [ nip zero? ] assoc-reject
>hashtable ;
! the maximum unicode char in the first 3 planes
[ root-cache get delete-at ]
[
\ vocab-file-contents "memoize" word-prop swap
- '[ drop first vocab-name _ = not ] assoc-filter! drop
+ '[ drop first vocab-name _ = ] assoc-reject! drop
] bi
\ all-vocabs-recursive reset-memoized
\ all-authors reset-memoized
[ alien>> expired? ] [ t ] if* ;
: delete-values ( value assoc -- )
- [ rot drop = not ] with assoc-filter! drop ;
+ [ rot drop = ] with assoc-reject! drop ;
PRIVATE>
! 2. Convert methods
: split-methods ( assoc class -- first second )
- [ [ nip class<= not ] curry assoc-filter ]
+ [ [ nip class<= ] curry assoc-reject ]
[ [ nip class<= ] curry assoc-filter ] 2bi ;
: convert-methods ( assoc class word -- assoc' )
GENERIC: update ( search-path-elt -- valid? )
: trim-forgotten ( qualified-vocab -- valid? )
- [ [ nip "forgotten" word-prop not ] assoc-filter ] change-words
+ [ [ nip "forgotten" word-prop ] assoc-reject ] change-words
words>> assoc-empty? not ;
M: from update trim-forgotten ;
[ nip ] assoc-filter ; inline
: assoc-harvest ( assoc -- assoc' )
- [ nip empty? not ] assoc-filter ; inline
+ [ nip empty? ] assoc-reject ; inline
: deep-at ( assoc seq -- value/f )
[ of ] each ; inline
} cond ;
: canonicalize ( assoc -- assoc' )
- [ nip zero? not ] assoc-filter ;
+ [ nip zero? ] assoc-reject ;
SYMBOL: terms
: client-streams ( -- assoc ) clients values ;
: username ( -- string ) client username>> ;
: everyone-else ( -- assoc )
- clients [ drop username = not ] assoc-filter ;
+ clients [ drop username = ] assoc-reject ;
: everyone-else-streams ( -- assoc ) everyone-else values ;
ERROR: no-such-client username ;
: multi-predicate ( classes -- quot )
dup length iota <reversed>
[ picker 2array ] 2map
- [ drop object eq? not ] assoc-filter
+ [ drop object eq? ] assoc-reject
[ [ t ] ] [
[ (multi-predicate) ] { } assoc>map
unclip [ swap [ f ] \ if 3array append [ ] like ] reduce
: base-pointer-groups-decoded ( word -- seq )
word>gc-info base-pointer-groups [
- [ swap 2array ] map-index [ nip -1 = not ] assoc-filter
+ [ swap 2array ] map-index [ nip -1 = ] assoc-reject
] map ;
! base-pointer-groups