Manifest constants (was const again)

Walter Bright newshound1 at digitalmars.com
Sat Dec 8 11:16:27 PST 2007


Derek Parnell wrote:
> On Sat, 08 Dec 2007 01:01:27 -0800, Walter Bright wrote:
> 
>> With the enum case, I doubt it would take more than a moment for someone 
>> to figure out what it was, and it is not confusingly similar to 
>> something else. Once one knows what it is, one might take a moment to 
>> ridicule the choice of keyword, but that's about it before getting past 
>> it and it becoming just more D jargon like static, class, and real.
> 
> True and sad. Another opportunity to "do the right thing" missed.

C'mon, it's not that big a deal!

> WILL THE NEW ENUM BE ALLOWED TO GROUP MANIFEST CONSTANTS TOGETHER?

No.

> WILL THE NEW ENUM INFER THE TYPE FROM ITS LITERAL?

Yes.

> WILL THE NEW ENUM BE ABLE TO USE CTFE?

Yes.

> For example ...
> enum
> {
>    defname = "upload.log",
>    float fudge = 61.74,
>    char starter = 'r',
>    qwerty = 0xF4,
>    foobar = SomeFunc("foobar")  
> }

No, that would be:

     enum defname = "upload.log";
     enum float fudge = 61.74;
     enum char starter = 'r';
     enum qwerty = 0xF4;
     enum foobar = SomeFunc("foobar");



More information about the Digitalmars-d mailing list