Are there range with interval like python range(start, end, interval)?

core::ops::Range also needs to support slicing, so there is no interval. but for scenarios like loops, interval is sometimes useful. Is it considered to add a core::ops::RangeInterval and possibly with syntactic sugar?

You can write (start..end).step_by(step), although step is usize, not the same type.

Do you have any ideas for syntactic sugar?
(There's not a lot of room for new syntax in expressions.)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.