chickadee » srfi-225 » dict-any

dict-any dto pred dictprocedure

Passes each association of dict as two arguments to pred and returns the value of the first call to pred that returns true, after which no further calls are made. If the dictionary type is inherently ordered, associations are processed in that order; otherwise, in an arbitrary order. If all calls return false, dict-any returns false.

(define (both-even? k v) (and (even? k) (even? v)))
(dict-any dto both-even? '((2 . 4) (3 . 5))) ⇒ #t
(dict-any dto both-even? '((1 . 2) (3 . 4))) ⇒ #f