Kotlin M12 is out
blog.jetbrains.com11 pointsby orangy7 comments
inline fun calc<T, R>(value: T, fn: (T)->R): R = fn(value)
inline fun identity<T>(value: T): T = calc(value) { it }
// This is optimised down to loading constant value 1 into variable x
val x = identity(1)
Besides having nice syntax for lots of everyday things Java developers are doing, we want to provide means for doing it effectively, clearly and maintainably.