Chain small scope functions while keeping each step explicit.

Scope Chain

ScopeChain.kt
fun main() {
    val word = 
    val result = word.let { value ->
        value.toUpperCase()
    }.let { upper ->
        "$upper:${upper.length}"
    }

    println("word=$word")
    println("result=$result")
}
fun main() {
    val word = 
    val result = word.let { value ->
        value.toUpperCase()
    }.let { upper ->
        "$upper:${upper.length}"
    }

    println("word=$word")
    println("result=$result")
}
fun main() {
    val word = 
    val result = word.let { value ->
        value.toUpperCase()
    }.let { upper ->
        "$upper:${upper.length}"
    }

    println("word=$word")
    println("result=$result")
}
scope-chain Scope functions can be chained, but each step should still have a clear result.