PhobosWatch: manifest => enum

Derek Parnell derek at psych.ward
Fri Dec 28 13:52:18 PST 2007


On Fri, 28 Dec 2007 12:26:53 -0800, Walter Bright wrote:

> 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.

So in short, 'enum' no longer stands for 'enumeration'.

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list