On 29/10/2011 5:06 AM, David Rajchenbach-Teller wrote:

Between "enum" and "union", I tend to favor "enum", for a simple
reason:
- attempting to use a variant as a C-style or Java-style enum will work
flawlessly;
- by opposition, attempting to use a variant as a C-style union will
fail for reasons that will be very unclear for C programmers.

If we have to rename it, I'd go with enum as well.

Also for mapping C libs into rust-ese, it'll be nice to support providing-the-numbers style, as in: "enum x { foo=2; bar=16; }", which we currently don't support, but should.

I'm not sure it's *that* weird for "enum" to be overloaded to mean "newtype" as well. People regularly use enum-in-C++ for just that reason: to make a type-disjoint int-like-thing. Let's try just renaming it and see how it goes.

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

Reply via email to