On 07/06/12 22:27, Patrick Walton wrote:
If you allow all block lambdas to have early returns with "ret", then this:

    fn f() {
        for int::range(1, 10) |i| {
            ret i;
        }
    }

Has a very different meaning from:

    fn f() {
        int::range(1, 10) |i| {
            ret i;
        }
    }

IMHO this is likely to be pretty confusing.
Fair enough, I can see where you are coming from.


Also, eliminating "do" makes this ambiguous:

    spawn() || {
        ...
    }

Is ambiguous with bitwise-or. This is also ambiguous:

    spawn || {
        ...
    }
As I understand it, given point 2 of the proposal, the above code would not be valid. Instead it would look like:

spawn(|| {
   ...
});

Is that correct? If so, would the semantics of the directly above be identical to:

do spawn {
   ...
}

?

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

Reply via email to