chickadee » srfi-196 » range-any

range-any pred range₁ range₂ procedure

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

Examples:

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