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 false.

Side effects
Modifies assoc

See also
assoc-filter, assoc-filter-as

Definition


: assoc-filter!
( ... assoc quot: ( ... key value -- ... ? ) -- ... assoc )
over
[ '[ _ keepd swap [ drop ] [ _ delete-at ] if ] assoc-each ]
keep ; inline