07-20-2023, 08:31 AM
Are these equivalent?
*
`val foo = someFooReturningFunction()`
* ```val foo get() = someFooReturningFunction()```
The way I understood the documentation they were, but in my own testing they are not.
With the *get()* `someFooReturningFunction()` is evaluated each time the property is accessed, without it is only evaluated once.
*
`val foo = someFooReturningFunction()`
* ```val foo get() = someFooReturningFunction()```
The way I understood the documentation they were, but in my own testing they are not.
With the *get()* `someFooReturningFunction()` is evaluated each time the property is accessed, without it is only evaluated once.