assoc-filter! ( ... assoc quot: ( ... key value -- ... ? ) -- ... assoc )
Factor handbook » The language » Collections » Associative mapping operations » Associative mapping combinators

Prev:assoc>map ( ... assoc quot: ( ... key value -- ... elt ) exemplar -- ... seq )
Next:assoc-reject! ( ... assoc quot: ( ... key value -- ... ? ) -- ... assoc )


Vocabulary
assocs

Inputs
assocan assoc
quota quotation with stack effect ( ... key value -- ... ? )


Outputs
assocan assoc


Word description
Removes all entries for which the predicate quotation yields true.

Side effects
Modifies assoc

See also
assoc-filter, assoc-filter-as

Definition


: assoc-filter!
( ... assoc quot: ( ... key value -- ... ? ) -- ... assoc )
[
over
[ [ [ drop ] 2bi ] dip [ delete-at ] 2curry unless ]
2curry assoc-each
] [ drop ] 2bi ; inline