Browse topics
Functional Kotlin
Scope Functions
let, run, with, apply and also scope functions explained.
scope functionslet Scope Function in Kotlinlet executes a block with object as argument. A Kotlin example with source code and sample output.scope functionsrun Scope Function in Kotlinrun executes block with object as receiver (this). A Kotlin example with source code and sample output.scope functionswith Scope Function in Kotlinwith is a non-extension function that calls block on object. A Kotlin example with source code and sample output.scope functionsapply Scope Function in Kotlinapply configures object using receiver block. A Kotlin example with source code and sample output.scope functionsalso Scope Function in Kotlinalso performs side effects and returns original object. A Kotlin example with source code and sample output.
Related topics
Lambda Expressions Lambda syntax, parameters, return values and anonymous functions. Higher Order Functions Functions as parameters, inline functions and return types. Delegates Property delegates, lazy, observable and class delegation. Generics Generic functions, classes, constraints, variance and star projection. Extension Functions Add new behaviour to existing types with Kotlin extension functions and properties.