On 12-06-07 10:27 PM, David Rajchenbach-Teller wrote:
What do you think?
alt would need to special-case its lookahead to try to figure out if the
block was a pattern block or an expresison block. But you can make the
'alt true' a little less weird-looking using unit. I think this reads
tolerably, and can be written today:
alt () {
_ if f() { ... }
_ if g() { ... }
_ { ... }
}
I guess we could make the arm-parser assume _ as a pattern, if it sees
an 'if' token there where it's expecting a pattern, letting you strip
that part. Then you'd get:
alt () {
if f() { ... }
if g() { ... }
_ { ... }
}
Good enough?
-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev