Iterators should be widely used in rust, but currently their notation is quite limiting. Below are three points that I would suggest to consider for extension of the iterators notation.
The first point is the ability to specify the type of the iterator. I am not sure what would be the best notation for this, probably something like:
(1..)u64.step_by(5)
The second point is the ability to operate on floats, for instance:
(1..-100)f64.step_by(-2.5)
The last point is regarding the exclusive upper bound. I agree this is convenient in some contests, because for instance 0..10
is similar to the typical C statement for (i = 0; i < 10; i++)
. However it can be source of bugs in other contests, for instance numerical computation. For this I would suggest to add the notation 0:10
with inclusive upper bound, which is used by MATLAB and many other numerical computing languages.