kqr
05/20/2022, 6:50 PMval x = if (y != null) y else {
<http://log.info|log.info>("bla")
z
}
vs
val x = y ?: run {
<http://log.info|log.info>("bla")
z
}
araqnid
05/20/2022, 6:57 PMval x = y ?: z.also { <http://log.info|log.info>("bla") }
?ephemient
05/20/2022, 7:03 PMy ?: <http://log.info|log.info>("bla").let { z }
if you want to preserve that ordering, but that's approaching a bit codegolf-yEndre Deak
05/20/2022, 8:49 PMz.also { <http://log.info|log.info>("bla") }
seems more idiomatic.
<http://log.info|log.info>(...).let { z }
could suggest that z
depends on the <http://log.info|log.info>
kqr
05/20/2022, 10:51 PM