More concise nested lambdas

Do you often make literally something like this?

thing.doSomething {
    doSomethingElse {
        ...
    }
}

Or maybe this is more like this:

thing.doSomething {
    myService.doSomethingElse(someParam) {
        ...
    }
}

Or:

thing.doSomething {
    // some code    

    doSomethingElse {
        ...
    }

    // some code
}

I ask because I think both latter cases are much more realistic and I’m not sure how this shortened syntax could work with such cases.

Also I’m not sure if this:

thing.doSomething -> doSomethingElse {
    ....
}

Is really much more concise than this:

thing.doSomething { doSomethingElse {
    ....
}}
2 Likes