Kotlin analog of ? ? ? in scala


#1

Sometimes while designing new components it’s easier to write signature and delay the implementation for later.
In Scala allows you to do so via ??? construct. Example:

val elements: List[Int] = ???
val result = process(elements)
println(result)

In Kotlin I can emulate it like that:

val noImpl: Nothing
    get() = throw kotlin.RuntimeException("not implemented")

(in some cases I will get warning “unreachable code” though)

But maybe stdlib already contains solution for that?


#2

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-t-o-d-o.html


#3

I really like the pragmatism and usability of Kotlin! TODO get’s even higlighted automatically in most environment (although I suspect that most devs are using IntelliJ IDEA anyway).