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 [
[ delete-at ] curry
[ [ keepd swap [ drop ] ] curry ] dip [ if ] curry
compose assoc-each
] keep ; inline