On 10/25/2011 12:52 AM, Marijn Haverbeke wrote:
This seems to make the feature not very useful. Is there a way we can get
around this limitation?
Why do you say that? It is trivial to get around this limitation, but
it seems that block calls like this in expression position would just
look even weirder than the form where you have the block inside the
parentheses. Compare

     let sum = reduce({|a, b| a + b}, myseq) + 2;

     let sum = reduce(myseq) {|a, b| a + b} + 2;

Do you prefer the second? I figured this would just be a trick to make
statement-style loops look better.

Not in this example, but I always want nicer ways to write spawn. Imagine a glorious future where spawn looks like

let task = spawn {
   ... do something ...
}

Yeah? Obviously there are a number of changes required to make that possible.

Regardless, putting the block in parens isn't a major headache (except that rust-mode and the pretty-printer don't like it).

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

Reply via email to