Hey guys, I was thinking why not have something in the language design that helps us with code organization and not affect the memory any how ?
I mean if we use the
val group = object { val myInt = 5 }
We are , AFAIK, creating an instance of an anonymous Class having an integer inside of it.
However if we had something that purely affects the code and gets cleaned up on compilation, it would be really great !
lets say something like:
codegroup group { val myInt = 5 }
And accessed like:
val someNewInt = group.myInt + 10
And after compilation the variable myInt
will look like group_myInt
for example