kirillrakhman
var value : Foo? = null fun getValue(param: Bar) : Foo { return value ?: createValue(param).apply { value = this } }