I don't know if that makes me happy or sad... if i...
# getting-started
x
I don't know if that makes me happy or sad... if if was an object, or function that took a lambda...
r
Wouldn't that get really messy? For example, what would you return from an
if
function that took a lambda, such that you could call
else
on it, but also so that
else
was only syntactically valid with a corresponding
if
, and also so that the return value of the if-else expression was the type you wanted? Kotlin is designed to be pragmatic rather than to have some overarching design principle like "everything is lambdas".