Guys. I can't decypher deep meening behind run ext...
# announcements
o
Guys. I can't decypher deep meening behind run extension funciton which has the form of public inline fun <R> run(block: () -> R): R = block() ? What is deep design thinking behind this
k
The advantage comes when you need a more involved initialization for a variable. For example:
Copy code
val something = run {
  // Some complex init
  // More logic
  // result gets passed to something
}