One doesn't know it is being used inside something...
# language-proposals
a
One doesn't know it is being used inside something else and if you use the keyword
fun
you are allowing and required to have a
return
. It is a declaration, not an expression. You just happen to be declaring it inline. Otherwise in a lambda you are more of a code snippet doing a little work and without a clear start to your body it isn't clear what you are returning from. It would be like an
if
statement allowing a return from the
if