:range

[syntax] :range vars stop

[syntax] :range vars start stop

[syntax] :range vars start stop step

SRFI-42: Runs through a range of exact rational numbers.

The form (:range vars stop) evaluates the expression stop, which mus t result in an exact integer n, and runs through the finite sequence 0, 1, 2, ..., n-1. If n is zero or negative the sequence is empty.

The form (:range vars start stop) evaluates the expressions start and stop, which must result in exact integers a and b, and runs through the finite sequence a, a+1, a+2, ..., b-1. If b is less or equal a then the sequence is empty.

The form (:range vars start stop step) first evaluates the expressions start, stop, and step, which must result in exact integers a, b, and s such that s is unequal to zero. Then the sequence a, a + s, a + 2 s, ..., a + (n-1) s is enumerated where n = ceil((b-a)/s). In other words, the sequence starts at a, increments by s, and stops when the next value would reach or cross b. If n is zero or negative the sequence is empty.