PhobosWatch: manifest => enum

Walter Bright newshound1 at digitalmars.com
Fri Dec 28 12:26:53 PST 2007


Steven Schveighoffer wrote:
> This is going to confuse the hell out of all newcomers, and I think there 
> are very few people who use D that actually think this is a good idea 
> (myself included).  There are much better ways to solve this problem than 
> destroying the traditional meaning of enum.

I understand your point, but also consider that adding yet a fourth way 
to declare constants is not going to be illuminating for newcomers, and 
it makes D look like a mishmash.

Furthermore, it does not destroy the meaning of enum. Already, you can 
do this in C, C++ and D:

   enum { x = 1, y = 2 }   // x and y are int's

we just extend it a bit so that they don't have to be all the same type:

   enum { x = 1, y = 2L }  // x is int, y is long

and allow the { } to be dropped if only one declaration is present. We 
also drop the requirement that enum types be only integral ones.



More information about the Digitalmars-d mailing list