Feature request: enum init shouldn't create a new enumeration

Ali Çehreli acehreli at yahoo.com
Sat Oct 13 11:42:19 PDT 2012


On 10/13/2012 11:01 AM, bearophile wrote:
> denizzzka:
>
>> Why in case its need to write name of the enum?
>
> Because D enums have a very simple design. But with() helps.

For me, that is the only benefit of 'with':

     final switch (me) with (MyEnum)
     {
     case first:  break;
     case second: break;
     case init: break;
     }

The other uses of 'with' are more like obfuscations.

>
> Bye,
> bearophile

Ali


More information about the Digitalmars-d mailing list