Manifest constants (was const again)

Denton Cockburn diboss at hotmail.com
Sat Dec 8 07:52:39 PST 2007


On Sat, 08 Dec 2007 20:58:52 +1100, 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.
> 
> WILL THE NEW ENUM BE ALLOWED TO GROUP MANIFEST CONSTANTS TOGETHER?

Yes.

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

Yes.

> 
> WILL THE NEW ENUM BE ABLE TO USE CTFE?
> 

Yes (would make sense, this is the only one I didn't see him asked and 
answer)

> (I only shout this time because these questions keep being ignored by
> Walter).

I disagree. I got the rest from him (and the thread).

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

Not sure about this, but I think they all end with ; instead of , 
separating

Walter - would both , and ; be allowed for this use of enum?



More information about the Digitalmars-d mailing list