enum class Color { RED, GREEN, BLUE }
// *** before: ***
val allOld: Array<Color> = Color.values() // a new array on every call,
// and the caller could change it
// *** in version 1.9: ***
val all = Color.entries // a read-only list, built once
fun main() {
for (c in Color.entries) println(c)
println(Color.entries.map { it.name })
println(Color.entries.first())
println(Color.entries.size)
println(allOld.size)
}