E.g.: ``` val <T> Iterable<T>.forEach ...
# language-proposals
o
E.g.:
Copy code
val <T> Iterable<T>.forEach : ForEachBuilder<T> get() = ForEachBuilder(this)
class ForEachBuilder<T>(val iterable: Iterable<T>)
fun <T> ForEachBuilder<T>.apply(function: T.() -> Unit) = iterable.forEach { it.function() }

fun main(args: Array<String>) {
    args.asList().forEach { println(it) } // normal forEach
    args.asList().forEach.apply { println(this) } // using builder
}
👍 1