With 1.0 release, I finally started looking at Kotlin docs [1]. For higher order functional support, the syntax is:
fun <T> lock(lock: Lock, body: () -> T): T { lock.lock() try { return body() } finally { lock.unlock() } }
Is there any technical reasons why normal function declarations are not using ‘->’ as a return operator ?.
fun hello(name: String) -> String { println(name) return "Hello", name }
Swift [2], Rust & others are using it.
It will just make the experience uniform with consistent Functional Types.
[1] https://kotlinlang.org/docs/reference/lambdas.html
[2] http://fuckingswiftblocksyntax.com