Kotlin high order function
Kotlin high order function
name | reference | return | invocation | is extension |
---|---|---|---|---|
with | this | lambda | kotlin.with {} |
$\times$ |
run | - | lambda | kotlin.run {} |
$\times$ |
run | this | lambda | input.run {} |
$\checkmark$ |
let | it | lambda | input.let {} |
$\checkmark$ |
also | it | this | input.also {} |
$\checkmark$ |
apply | this | this | input.apply {} |
$\checkmark$ |
with
Grouping function calls on an object: with
1 |
|
run
Object configuration and computing the result: run
Running statements where an expression is required: non-extension run
extension version
1 |
|
function version
1 |
|
let
Executing a lambda on non-null objects: let
Introducing an expression as a variable in local scope: let
1 |
|
also
Additional effects: also
1 |
|
apply
Object configuration: apply
1 |
|
Kotlin high order function
https://rug.al/2023/2023-02-24-kotlin-high-order-function/