Interesting rant about Scala's issues
Leandro Lucarella
luca at llucax.com.ar
Sat Apr 5 02:40:36 PDT 2014
bearophile, el 4 de April a las 18:39 me escribiste:
> Walter Bright:
>
> Thank you for the answers.
>
> >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
>
> In the last months I've grown a moderate desire for optionally
> strongly typed array indexes in D (as seen in Ada, but with a
What about:
enum Int : int { One = 1, Two, Three } // implicitly casteable to int
enum Symbolic { Dogs, Cars, Trees } // not implicitly casteable (and
// maybe not even expose the
// internal value)
?
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
More information about the Digitalmars-d-announce
mailing list