Luke
04/04/2019, 2:53 PMitems.forEach {
it.apply {
...
}
}
tseisel
04/04/2019, 3:25 PMinline fun <T> Iterable<T>.each(block: T.() -> Unit) {
for (el in this) {
el.block()
}
}
Usage :
listOf("Hello", "World").each { // this: String
println(length)
}
Luke
04/04/2019, 3:27 PM