https://kotlinlang.org logo
#tornadofx
Title
# tornadofx
g

geepawhill

03/18/2020, 1:40 PM
I have a bunch of javafx properties that should be read-only externally. Is this the right way to do that? It seems weird that s is val. I'm wondering if the compiler will wind up caching that val after one fetch.
r

Romanow

03/20/2020, 9:24 AM
It won't, the by keyword delegates the val to the getValue of the property. val does not mean that the value does not change, it means that it cannot be re-assigned.
g

geepawhill

03/24/2020, 3:38 AM
Excellent, thank you!
4 Views