lee.crawford
class Nesting (val parent: Nesting? = null) { val map = mutableMapOf("id" to nextId ()) override fun toString(): String = "${map["id"]}" companion object { private var count = 0 fun nextId () = count ++ } } fun main () { val a = Nesting (Nesting (Nesting ())) println (a.map) println (a.parent?.map.get ("id") ?: "?") }
ephemient
?.
a?.b
if (a != null) a.b else null
something?.let { listOf(it) }.orEmpty()
.orEmpty()
null
CLOVIS
(a ?: return null).b
.bind
.
Rob Elliot
A modern programming language that makes developers happier.