[iterate-devel] for i in-vector downto 0 by 2 yields what?
Arthur Lemmens
alemmens at xs4all.nl
Fri Nov 12 16:15:01 UTC 2004
Andreas Fuchs wrote:
> (iter (for i index-of-vector #(0 1 2 3 4) downto 0 by 2)
> (collect i))
> ; (4 2 0)
>
> (iter (for i index-of-vector #(0 1 2 3 4) downto 0 by 3)
> (collect i))
> ; (3 0)
>
> I'm undecided as to which is preferable. Your interpretation has the
> advantage that it's more in line with the behavior of the counting FOR
> driver, so I'm tending towards that.
FWIW, I totally agree with Joerg's interpretation.
(iter (for i from 4 downto 0 by 3) (collect i)) returns (4 1),
so I would expect that (iter (for i index-of-vector #(0 1 2 3 4) downto 0 by 3)
also returns (4 1), NOT (3 0).
Regards,
Arthur Lemmens
More information about the iterate-devel
mailing list