chickadee » ck-macros » c-any

(c-any '(OP ...) L) → result or '#fsyntax

Calls the operation on each value in the given list until it finds a result that is not '#f, then yields that result. Yields '#f if the predicate yields '#f for all items in the list, or if the list is empty.

Analogous to any from SRFI-1.

(ck () (c-quote (c-any '(c-pair?) '())))
;; ==> '#f
(ck () (c-quote (c-any '(c-pair?) '(a b c))))
;; ==> '#f
(ck () (c-quote (c-any '(c-pair?) '(a (b . c)))))
;; ==> '#t

(ck () (c-quote (c-any '(c-cons 'z) '(a b c))))
;; ==> '(1 . a)
;; Because (c-cons 'z 'a) yields a value that is not '#f.