still-dreaming-1
05/13/2020, 8:10 PMShawn
05/13/2020, 8:12 PMWill the get be called each time or is it gotten once and then reused?It will perform the logic in the getter each time it’s invoked. You can implement a sort of lazy or cached
valShawn
05/13/2020, 8:14 PMvalstill-dreaming-1
05/13/2020, 8:18 PMCasey Brooks
05/13/2020, 8:31 PMvarvalget()lazy { }Casey Brooks
05/13/2020, 8:34 PMclass Foo {
    // this property is a list that can be changed, but the list can also be reassigned
    private var mutableBar: MutableList<String> = mutableListOf()
    
    // this makes a read-only property that always returns the current state of mutableBar, not a cached copy of it
    val readOnlyBar: List<String> get() = mutableBar
}still-dreaming-1
05/13/2020, 8:36 PM