On 11/30/13 7:25 PM, Michael Letterle wrote:
    I've got to say that the "do" syntax is one of the things that
    appeals to me about Rust, and will probably appeal to the people
    that Steve Klabnik is drawing to the language with Rust for Rubyists.

    It might seem like a small thing but the effects on the type of
    programs you can write, it actually has a pretty profound effect, IMO.

    --
    Tony Arcieri


I agree actually, I was using do to implement some convenience logic and
my code went from:

     do function { someotherFunction() };

to

     function(|| someotherFunction());

Maybe I'm abusing something here, but I found the first format more
intuitive and elegant...

I know there's rumblings about io conditions going away, but the change
also makes that more awkward... :/

The point of this change was to got rid of closure type inference. With the old rules it was not possible to see whether you were allocating without looking at the type signature of the function you're calling. Moreover the capture rules are extremely different depending on the type of closure it is. It's too much magic for Rust.

Patrick

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

Reply via email to