What is Nostr?
Dmitry Kandalov /
npub1se9…axaf
2024-07-19 15:47:16

Dmitry Kandalov on Nostr: I don't remember if I ever really needed it, but you can have higher-order extension ...

I don't remember if I ever really needed it, but you can have higher-order extension functions in #Kotlin. For example:

fun f(): Int.() -> Int =
{ this + 1 }

fun main() {
val extF = f()
require(42.extF() == 43)
}
Author Public Key
npub1se9ljj7s632gmj2y66j6fxpr6v4lfsw7yu757umkltv0stsk8fpq96axaf