On Thu, Jul 25, 2013 at 2:56 AM, Graydon Hoare <[email protected]> wrote:
>
> for <pattern> in <expr> { ... }
>
>
What about changing the order?
I mean:
in <expr> for <pattern> { ... }
or
loop <expr> with <pattern> { ... }
Then the coder can drop the pattern part without making the wording weird:
loop 10.times() { ... }
My motivation is actaully something different: I feel this order more
intuitive. I during coding generally like to be able to write the code in
the order that I think. When I want to write a loop, first I think about
that I want to iterate over some collection. Only after that do I think
about a suitable name for the loop_variable / iterator. I understand that
most programming languages use the <pattern> <expr> order and that
programmers are used to it, but I think to be be intuitive is more
important than to be similar, especially for a new language.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev