chickadee » srfi-217 » make-range-iset

make-range-iset start end #!optional stepprocedure

Returns a newly allocated iset specified by an inclusive lower bound start, an exclusive upper bound end, and a step value (default 1), all of which are exact integers. This constructor produces an iset containing the sequence

 start, (+ start step), (+ start (* 2 step)), …, (+ start (* n step))

where n is the greatest integer such that (+ start (* n step)) < end if step is positive, or such that (+ start (* n step)) > end if step is negative. It is an error if step is zero.

Examples:

   (iset->list (make-range-iset 25 30)) ⇒ (25 26 27 28 29)
   (iset->list (make-range-iset -10 10 6)) ⇒ (-10 -4 2 8)