Is there a natural way to have a multiple sentence...
# announcements
p
Is there a natural way to have a multiple sentence block as the right side of an elvis operator? So far I can type only a single expression and if I add curly braces it is detected as a lambda. I have implemented
Any?.orElse(block: () -> Nothing)
which works for the purpose like a charm but then I wonder why there isn't anything like that in the language itself or the stdlib, maybe I am missing something?
p
Copy code
expression ?: run {
    defaultValue
}
p
omg thank you!
p
no problem 🙂
p
at least I had a couple minutes of fun creating that useless function 👽
😁 1