Interesting rant about Scala's issues

Meta jared771 at gmail.com
Fri Apr 4 11:15:41 PDT 2014


On Friday, 4 April 2014 at 18:02:02 UTC, Walter Bright wrote:
> Here's one:
>
>   enum Index { A, B, C }
>   T[Index.max] array; // Error: Index.max is not an int
>   ...
>   array[B] = t;   // Error: B is not an int
>
>
> And another:
>
>   array[A + 1] = t; // Error: incompatible types Index and int
>
> And another:
>
>   enum Mask { A=1,B=4 }
>
>   Mask m = A | B;   // Error: incompatible operator | for enum
>
> and on it goes. These are routine and normal uses of enums.

It's trivial to write an EnumMemberValue template that convert 
the enum member to its underlying value at compile time. Also, if 
I remember correctly, min and max are terribly broken for enums 
in the first place.


More information about the Digitalmars-d-announce mailing list