|
|
|
|
|
by hn8726
315 days ago
|
|
Kotlin also has extensions function `let` (and a couple of variants) which let you chain arbitrary methods: ```
val arr = ...
val result = arr
.let { column(it, "tags")
.let { merge(it) }
.let { unique(it) }
.let { values(it) }
``` You add function references for single-argument functions too: ```
arr.let(::unique) // or (List<>::unique), depends on the function
``` all without adding a special language construct. |
|