Maybe the begin and end can be addedy but not replaced as of breaking channges ![]()
And for me the coroutines are indeed a source of confusion stress.
About the confusion, I think at myself that it indeed is clear what the ternary operator does.
(you do almost the same with nullable if it is null : ?: else: ?.)
(text == null)? first() : second()
text ?.let{first()} ?: second()
or shorthand:
(text == null)?: second()
text ?: second()
(witch is obviously not possible)
I however think there can be beter use-cases for the colon:
- Making it an oprator fun for creating a range that can go both up and down
- The equivalent of
tofor a mapEntry, such that the forEach with receiver now can refer tokeyandvalueinstead offirstandsecond
And in kotlin, I always will associate the questionmark with nullable and I hope it stays that way.