On 4/18/12 5:07 PM, Jeff Schultz wrote:
Any reason we can't just have an empty '||' instead of the '->'?

It's easier to type and makes it easier to find all closures.

|| looks a little like line noise to me, although I'm not wedded to the thin arrow.

    spawn(): -> {
        log("Hi!");
    }

vs.

    spawn(): || {
        log("Hi!");
    }



3. In any function call, trailing closure arguments can be pulled out and
placed after a colon. If this is done, the semicolon statement separator
after the call can be omitted.

Why is the ':' needed?

To disambiguate a block from bitwise or.

Patrick
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to