On 13-07-25 05:42 AM, Benjamin Striegel wrote:

> As a professional Javascripter, I implore you keep `do` as it is. It
> really and truly is a world of difference between:
> 
>     do foo {
>         ...
>     }
> 
> and:
> 
>     foo(|| {
>         ...
>     });
> 
> It's one of my favorite features of Rust, and it makes higher-order
> functions feel like first-class citizens.

Ok. Nice feedback :)

>> for _ in 10.times() { ... }
> 
> As the original creator of `10.times`, I was under the impression that
> we'd be moving from `for` to `do` once this change is complete. As in:
> 
>     do 10.times { ... }
> 
> I'm baffled as to why people think something so simple and intuitive is
> "clever". :P

If we did that, we'd lose the ability to break or return, since 'do'
doesn't follow the for-style loop protocol. Maybe not that important.

-Graydon

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to