chickadee » ck-macros » c-every

(c-every '(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.

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

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