Error in iota-range Wolfgang Corcoran-Mathe (27 Sep 2020 01:32 UTC)
Re: Error in iota-range John Cowan (27 Sep 2020 19:35 UTC)
Re: Error in iota-range Arthur A. Gleckler (27 Sep 2020 20:25 UTC)
Re: Error in iota-range Marc Nieper-Wißkirchen (27 Sep 2020 21:10 UTC)

Error in iota-range Wolfgang Corcoran-Mathe 27 Sep 2020 01:32 UTC

The SRFI states that (iota-range length start step) produces the
sequence:

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

This contradicts the meaning of the `length' argument, since this is
a sequence of length + 1 terms.  The final term should be

    (+ start (* (- length 1) step)),

as in SRFI 1's iota.  The sample implementation produces the expected
sequence.

Regards,

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>

"Earth is the cradle of the mind, but one cannot live in a
cradle forever." --Konstantin Tsiolkovsky