Multiple ranges for range-fold, range-for-each, ... Marc Nieper-Wißkirchen 31 Aug 2020 08:49 UTC

I just noticed that "range-for-each", "range-fold", ... only take a
single range argument. (*)

Their models in SRFI 1 can take more than one list (short-circuited on
the smallest list). The same is true for other data structures in R7RS
like vectors or generators.

For consistency and to increase the applicability of ranges, I,
therefore, suggest allowing all these procedures to take more than one
range argument.

Example application:

(define (range=? =? range . range*)
  (and (apply = (range-length range) (map range-length range*))
         (apply range-every =? range range*)))

Speaking of this, wouldn't range=? be a plausible addition as well?

Marc

--

(*) I must have been blind earlier. :(