chickadee » ck-macros » c-every1

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

Calls the operation on each value in the given list until it finds a result that is '#f, then yields '#f. If the predicate yields a non-'#f value for every item in the list, this yields the result of calling the predicate on the last item. Yields '#t if the list is empty.

Analogous to every from SRFI 1, but only accepts one list. Prior to version 0.2.0, this was named c-every.

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

(ck () (c-quote (c-every1 '(c-cons 'z) '(a b c))))
;; ==> '(z . c)
;; Because all results were non-'#f and (c-cons 'z 'c) was the final operation.