Draft proposal: allow the use of relational operators on Comparable classes
alexdmiller at yahoo.com
Thu Mar 12 12:19:14 PDT 2009
Kevin Bourrillion <kevinb at google.com> said:
> But focusing on enum types sidesteps one set of problems in favor of
> another. That being that most user-defined enum types do not actually have
> any logical order, and many that _seem_ to have an order do not actually
> have that order guaranteed.
I would love to have the relational operators on enums...when it makes sense. What if there was a marker interface that your enum could implement? Something like OrderedEnum?
I suppose it might be bad form to have the language behavior as to whether something is legal be dependent on a marker interface. But you guys are the experts.
More information about the coin-dev