[nem-en] [RFC] qualified variant options
Wiktor Zychla
wzychla at vulcan.edu.pl
Fri Sep 24 11:33:23 CEST 2004
> variant A { | B | C }
>
> defines A, B and C. We consider the change, so it would define A, A.B
> and A.C.
>
> + it would unify variants with enums more
> + it would be possible to drop E_, T_ and similar prefixes, vs longer
> and more readable type names
> - it will need extra keystrokes
> - it breaks compatibility
>
> Anyway we would like to know what people think about it?
I am for it.
Frankly, I was disappointed that variant subtypes are not qualified with the
base type name because it does not allow to have two subtypes with the same
name. That is not ellegant.
// impossible in Nemerle 2.1, hope to see it in future
variant Tree {
| ...
| Empty;
}
variant List {
| ...
| Empty;
}
Wiktor
More information about the devel-en
mailing list