> Temporary variables are usually a bad idea in Functional Programming style
Oliver Weiler

well, mutating temp var are definitely not functional, but what I meant is something more subtle about the Haskell let or where syntax.
You can assign some intermediate calc to a var, but it must be either an input or an output for each block.
What you cannot do in Haskell (for a very good reason) is to assign a var in the middle of your block.
I think scope functions help us to do the same in Kotlin.

Like what you read? Give Uberto Barbini a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.