Dicebot, el  7 de April a las 12:04 me escribiste:
> On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote:
> >Got a DIP/spec/design to share?
> >
> >R
> I think biggest mistake of D enums is merging constants and actual
> enumerations into single entity which has resulted in weak typing of
> enumerations.


enum E { A = 1, B = 2 }

is the same as:

struct E { immutable A = 1, B = 2; }

(leaving storage aside)

Which for me it doesn't make any sense. Even thinking about the argument
(you should have a big gain to introduce syntax sugar).

enums should be enums, flags should be flags, and manifest constants
should be... well, you got the idea.

enum is to D what const is to C++ :P

Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
The average person laughs 13 times a day

Reply via email to