Lambda with receiver
Feature in Kotlin: https://kotlinlang.org/docs/lambdas.html#function-types
Maybe not actually that groundbreaking but allows for some pretty cool meta-programming / DSL construction, such as Kotlin’s builders. For example:
val map = HashMap().apply {
put(0, "0")
for (i in 1..10) {
put(i, "$i")
}
}
put is an instance method of the HashMap but we can call it implicitly without prefixing this allowing for a fairly terse syntax.