Re:Kotlin 1.4
by vvillena on Tuesday August 18, 2020 @08:45AM
(#24197942)
This is a very common idiom in Scala. Function definition is slightly different, but usage is the same.
[ Parent
| on HN ]
Any example ? or an idiom name I can google ?
Groovy also does it. I have no idea what the name is though: https://mrhaki.blogspot.com/2009/11/groovy-goodness-passing-...
Not sure about the exact name. But kotlin also has "function with receiver" that together with this makes it very easy to write almost a custom domain language on top of kotlin.
Can't edit, but here's an explanation https://kotlinlang.org/docs/reference/type-safe-builders.htm...
Swift calls it trailing closure syntax