Jumping back to an old thread:

Yes, except that continue/break/ret would be valid in the latter but not the former.

It seems like we should allow continue or break but not both. And it seems mildly inconsistent to allow breaks in a `do` but not other blocks. Perhaps we should just allow `break` in any block? After all, we want to allow labeled break and continue—this extends naturally to blocks. In Java, for example, the following is permitted:

outer: {
if (cond) { ... break outer; }
...
}
...

This is kind of a structured goto, in that it cannot create irreducible graphs. Truth be told though I always found it a bit hard to read. I think this is because the `break outer` references a label defined on top, but in fact jumps to the bottom of the block.


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

Reply via email to