Interesting rant about Scala's issues

Leandro Lucarella luca at llucax.com.ar
Tue Apr 8 02:20:53 PDT 2014


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.

Yeah,

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


More information about the Digitalmars-d-announce mailing list