Interesting rant about Scala's issues
Leandro Lucarella
luca at llucax.com.ar
Sat Apr 5 18:28:53 PDT 2014
Walter Bright, el 5 de April a las 11:04 me escribiste:
> On 4/5/2014 2:40 AM, Leandro Lucarella wrote:
> >enum Symbolic { Dogs, Cars, Trees } // not implicitly casteable (and
> > // maybe not even expose the
> > // internal value)
> >
> >?
>
>
> struct Symbolic {
> private static struct _impl { private int x; }
> enum Dogs = _impl(0);
> enum Cars = _impl(1);
> enum Trees = _impl(2);
> }
>
> Of course, you can hide all this in a template.
Well, you can "emulate" enums as they are now with structs too, so that
doesn't change anything in the argument about why to provide syntax
sugar for one and not the other.
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
More information about the Digitalmars-d-announce
mailing list