If we want to attach statements to a non-null valu...
# stdlib
m
If we want to attach statements to a non-null value without affecting that value returned, we can use
?.apply
or
?.also
but for doing the same when the value is null I end up doing something like
Copy code
?: run {
    …
    null
}
or even
?: null.apply { ... }
Is there a way to write this without having to specify
null
again?