Milan Hruban
05/04/2020, 11:28 AM3. The Smart-Cast Elvis Operator approach
? (You have two number threes btw). I understand that it's less characters, but you still have to translate it to the good old if
when reading the code, right?elye
05/04/2020, 11:39 AMcouldBeNullMesage ?: return
… It’s almost like reading Java ternary…
trueOrFalse ? doOnTrue : doOnFalse;
Milan Hruban
05/04/2020, 12:00 PMthana
05/04/2020, 12:05 PMelect
05/04/2020, 12:52 PMguard
is pretty useless otherwiseSteve
05/04/2020, 4:53 PMelect
05/04/2020, 5:01 PMelye
05/05/2020, 9:25 AMcouldBeNullMesage ?: run { println("hello there"); return }