On 01/07/2012 10:52 PM, Brian Anderson wrote:

Today Rust has a new closure syntax:

     let two_three_four = [1, 2, 3].map( |i| i + 1 );

That's pretty great. Especially since it runs entirely in stack allocations. Whee.

     let x = cat, y = dog, z = turnip;
     let party = |w, move x, copy y| w + x + y + z;

Argument and return type annotations are optional.

     let party = |x: Cat, y: Dog| -> Octopus x + y;

These are some remarkable parties.

Empty argument lists can be omitted in both `for` and `do`

     do spawn {
         ...
     }

Yep!

Cool. Looks like it'll handle a lot of control abstractions without looking strange; I was a doubter but now I'm a believer. Bravo!

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

Reply via email to