chickadee » srfi-196 » range-every

range-every pred rangeprocedure

Applies pred element-wise to the elements of the ranges and returns true if pred returns true on every application. Specifically it returns the last value returned by pred , or #t if pred was never invoked. Otherwise, #f is returned. If more than one range is given and not all ranges have the same length, range-every terminates when the shortest range is exhausted. The runtime of this procedure is O(s) + O(k), where s is the sum of the total accessing times of the ranges and k is the number of ranges.

Examples:

(range-every integer? (numeric-range 0 10)) ⇒ #t
(range-every odd? (numeric-range 0 10)) ⇒ #f
(range-every < (numeric-range 0 10 2) (numeric-range 5 15)) ⇒ #f