On 22/10/2012 6:52 AM, Henri Sivonen wrote:

> I can make the translator generate integer literals as the patterns
> for the arms of the match. However, I think the generated Rust code
> would be nicer for humans to read with char literals in the patterns.

Write it like: "match c as char { ... }" then. I imagine the resulting
generated code is identical.

> I suggest allowing char literals when matching on an integer (or when
> otherwise comparing to an integer or when assigning to an integer
> variable) as long as the Unicode code point of the character
> represented by the character literal is not greater than the largest
> integer representable by the integer type.

Interesting possibility. As in: add char literals to the set of types to
which integer-type inference applies?

> (Aside: I liked the old syntax without => and with mandatory braces
> around each arm better.)

Me too, but I think we're done changing that part :)

-Graydon

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

Reply via email to