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

Prev:assoc-partition ( ... assoc quot: ( ... key value -- ... ? ) -- ... true-assoc false-assoc )
Next:assoc-all? ( ... assoc quot: ( ... key value -- ... ? ) -- ... ? )


Vocabulary
assocs

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


Outputs
?a boolean


Word description
Tests if the assoc contains an entry satisfying a predicate by applying the quotation to each entry in turn. Iteration stops if an entry is found for which the quotation outputs a true value.

Definition


: assoc-any?
( ... assoc quot: ( ... key value -- ... ? ) -- ... ? )
assoc-find 2nip ; inline