On Sat, Nov 30, 2013 at 10:28 PM, Patrick Walton <pcwal...@mozilla.com> wrote: > 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. >
Maybe `do` can just change from procs to closures. I can't really say how often I've actually wanted a proc. Task bodies are a far minority compared to other uses of do, from the backlash, and I don't find `spawn(proc() { ... })` that unappealing. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev