문제

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 ) ?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top