3 ms·
As far as I understand, Kotlin doesn't actually have first class blocks like Ruby, despite the appearance that it does. Instead, blocks are syntactic sugar for
by nerdponx 3y ago
As far as I understand, Kotlin doesn't actually have first class blocks like Ruby, despite the appearance that it does. Instead, blocks are syntactic sugar for anonymous functions, so
y = foo() {
bar(it)
}
is just pretty syntax for
y = foo({ it -> bar(it) })