Closed bates64 closed 7 years ago
I made it not include the upper bound because when you work with arrays, the length of an array is always one more than the index of the last element, although if you can iterate directly over the items of an array using for each, it might not matter.
I wouldn't want to change the range syntax to 1 up to 5
because you can include a by clause to make it 5 to 0 by -1
, which wouldn't make sense with 5 up to 0 by -1
.
Speaking of which, I just realized that the code generated for for each loops that iterate backwards is broken! D:
Sure! Having the through
syntax there couldn't hurt, though, could it? :stuck_out_tongue_winking_eye:
I'll think about it, but first I need to make it work! :P
For future reference, @nanalan did this.
Looking at the tutorial, this:
Doesn't display 5. (
1 2 3 4
)I propose another expression:
Which displays
1 2 3 4 5
. Alternatively,1 up to 5
?Through definition regarding this: