Storage class consistency

Robert Fraser fraserofthenight at gmail.com
Sat Apr 5 12:39:56 PDT 2008


Okay, I know everyone wants to put "enum" to rest, but I just want an 
explanation for why "enum" was chosen in the facre of syntactic 
difficulties. In particular, what I mean is that for every other storage 
class the following is possible:

public
{
     int x =  5;
     float f = 7.0;
}

const
{
     int x = 5;
     float y = 7.0;
}

... but not with enum ...

enum
{
     int x = 5;
     float y = 7.0;
}

... which instead must be used as ...

enum int x = 5;
enum float y = 7.0;

I understand Walter probably thought it through and decided that this 
inconsistency was worth it to be able to use a confusing keyword, but 
these are the sort of reasons it's difficult for me to get excited about 
D2. Is there any particular reason this was thought unimportant?



More information about the Digitalmars-d mailing list