Well, constant increments of N can be simulated with |let i =  i * N;|
in the body of the loop. There's an issue open right now about making
range do the right thing when presented with a range going in reverse.

Cheers,
Josh

On 1 February 2013 12:28, Alexander Stavonin <[email protected]> wrote:
> Thanks, it better than nothing, but… It works only for i++; how can I write
> i += 2 or i--?
>
> On Feb 1, 2013, at 9:23 PM, Josh Matthews <[email protected]> wrote:
>
> The int/uint::range methods would seem to do the job: for
> uint::range(0, 10) |i| { io::println(fmt!("%u", i)); }
>
> Cheers,
> Josh
>
> On 1 February 2013 12:14, Alexander Stavonin <[email protected]> wrote:
>
> Have we a pretty looks solution for auto incrementation counters during
> loops? I mean something like C/C++ style for loop.I found an example in the
> manual "10.5 For loops" but it looks ugly with counter outside the loop.  Is
> it only way for solving problem?
>
> Thanks.
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to