I did notice that it could add some readability to...
# stdlib
d
I did notice that it could add some readability to code in some cases:
Copy code
fun welcome() = "Hello"
    fun farewell() = "Good-bye"
    fun getFunction(b: Boolean) = if (b) ::welcome else ::farewell

    // Not very readable
    println(getFunction(true)())

    // A little more readable
    println(getFunction(true).invoke())

    // Also a little more readable - possible use case for `run()`
    println(run(getFunction(true)))