[swift-evolution] Lambda function syntax

Alexander Regueiro alexreg at gmail.com
Mon Dec 21 13:20:35 CST 2015


Does anyone not like the current syntax for this?

I would propose changing it from:

{ (param_list) -> return_type in … }

to something cleaner like:

(param_list) -> return_type => { … }

where I’m not so bothered about the `=>` separator (could be `:`, `,`, or indeed `in`).

The braces being around the type specifier as well as function body rather bothers me. Surely it would be more consistent just to have the braces around the function body, and then the type specifier preceding this?

Alternate syntaxes welcome, but I think the suggestion above already represents a significant improvement.



More information about the swift-evolution mailing list