Quoting Daniel Bonniot <[email protected]>:
> On the other, it's true one can discuss if their presence is justified. If
> you see them as a special notation to declare many related classes or
> instances, they don't complexify the language too much (as they can be
> explained by their translation), and they come in handy in some situations.
> From the Java enum proposal:
> public enum Rank { deuce, three, four, five, six, seven, eight, nine,
> ten, jack, queen, king, ace }
> might be a good example, no?
That example was only used to justify the VALUES and toString() semantics of JDK
1.5 enumerations; there is no dispatch/matching of the literal values in that
example. I think we need an example that dispatches over the literals but cannot
be better written using multimethods. Otherwise, we would have to say that
VALUES and toString() are the motivation for having enumerations which seems to
be a weak justification.
- Brian
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.