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

Prev:assoc-map-as ( ... assoc quot: ( ... key value -- ... newkey newvalue ) exemplar -- ... newassoc )
Next:assoc-filter-as ( ... assoc quot: ( ... key value -- ... ? ) exemplar -- ... subassoc )


Vocabulary
assocs

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


Outputs
subassoca new assoc


Word description
Outputs an assoc of the same type as assoc consisting of all entries for which the predicate quotation yields true.

See also
assoc-filter-as, assoc-filter!

Definition


: assoc-filter
( ... assoc quot: ( ... key value -- ... ? ) -- ... subassoc )
over assoc-filter-as ; inline