Join Slack
language design question... any strong reasons why lambdas' curly braces are including the parameter...
# announcements
p
Pere Casafont
02/25/2018, 6:48 PM
language design question... any strong reasons why lambdas' curly braces are including the parameters unlike in java or typescript?
e
elizarov
02/26/2018, 7:02 AM
It works better with an
it
parameter and this way user-defined constructs looks more like built-in into the language. Great for DSLs.
p
Pere Casafont
02/26/2018, 11:52 AM
yes, it is nice for single parameter lambdas, but what about 2 params or more? { x, y -> doStuff } looks strange imho
Pere Casafont
02/26/2018, 11:54 AM
if parameters can be omitted, why can't they go outside the braxes in the cases they are not omitted?
Pere Casafont
02/26/2018, 11:54 AM
braces*
3
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by