Question

What is the reason why they decided not to implement enum type in Scala ? What are benefits of current language design (defining object and extending scala.Enumeration instead of creating new enum type ) ?

Était-ce utile?

La solution

I don't see any reasonable benefits of Enumeration in it's current state and tend to think it is design flaw that scala community is trying to overcome. It is not easy, but I guess this is definitely will be done in next two major scala versions. In all scala code I've seen sealed object hierarchy was given a preference.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top