
July 25, 2011
10:23 a.m.
On Jul 24, 2011, at 11:32 PM, Chris Rebert wrote:
- Why violate TOOWTDI by having both SomeEnum(...) and SomeEnum[...] that do the same thing?
I don't remember exactly, but there was some historical reasons for including both syntaxes.
- Why is it .enumname and not simply .name? .enumname could also be confused as getting the name of the overarching enum rather than the name of the particular enum value.
Again, historical accident. Probably .enumname was chosen to mimic .enumclass, since obviously .class couldn't be used. Since these are attributes on enumeration values, .name and .enum might have been better choices. Cheers, -Barry