elect86
(Giuseppe Barbieri)
1
Is there a way to initialize a top non-optional variable with a snippet of code other than using lazy?
In Kotlin I can simply val x = run { ... } to say
DeFrenZ
(Davide De Franceschi)
2
If I understood what you want to do, you can immediately evaluate a closure.
E.g.
let value = { /* snippet */ }()
1 Like