Interesting rant about Scala's issues

Walter Bright newshound2 at digitalmars.com
Sat Apr 5 11:04:40 PDT 2014


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.


More information about the Digitalmars-d-announce mailing list