[MWForum]Dotimes (re: wish list)
Daniel Ajoy
mwforum@lists.mathcats.com
Sun, 24 Nov 2002 19:33:55 -0500
On 24 Nov 2002 at 16:31, Mike Sandy wrote:
> There will always be some programs for which the range: 0 to n-1,
> is preferable to: 1 to n, I've written both and so I'm sure have you,
> but that was not the point I was making.
For some reason, I have come across many more in which 0 is preferable.
> I notice that REPCOUNT was included in your group "wish list",
> but no mention of removing DOTIMES.
>
> If both REPCOUNT and DOTIMES are present then I am arguing
> on the basis of consistency, for the same range.
I understand. I like consistency, too. And I guess at this point
consistency is more important than the minor inconveniences that
cause "repeat" starting at 1. I was just curious about your reasons.
> For practised programmers it may be little effort to
> remember the different ranges but for young learners
> it is yet another item, to add to the exceptions. So make the ranges
> the same.
I agree.
> The reason I chose an initial value of 1, was
> I use MSWlogo as well as MW, as I'm sure do others, in which
> case a change for the range of REPCOUNT would be a disadvantage. What
> about yourself?
I use LogoFE's "iota" :)
show iota 10
[0 1 2 3 4 5 6 7 8 9]
and do things like:
cs foreach iota 10 [setturtle ? rt random 360 fd 100]
Daniel
OpenWorld Learning