Вопрос

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