So imagine you’re trying to pay attention to performance/cache coherency, but also want the freedom of working with String literals. You’d want something like this:
val foo = myMap["Name"]
To really do something like this:
const val ID = "Name".hashCode() val foo = myMap[ID] // ID usually unique, can report in case of failure
ID is computed at compile time. Normally to accomplish this, you’d need something like
constexpr from C++, which as far as I’m aware, isn’t anywhere on the radar for Kotlin. Is there another way to accomplish this in Kotlin? Would a compiler plugin be sufficient? Any tips here? Thanks.