[swift-evolution] Proposal: Always flatten the single element tuple
deschnl at icloud.com
Thu Jun 8 17:09:39 CDT 2017
As a "regular user" I wholeheartedly agree with everything Robert just said. Syntactic consistency between function parameters and closure parameters is a big win for usability and discoverability.
I actually did not know that it was possible to destructure tuples in closure arguments before this discussion happened. If the syntax had been more explicit and consistent (parens required for arguments and tuples as described below and in previous emails) I could have discovered this great feature on my own a long time ago.
> On Jun 8, 2017, at 5:39 PM, Robert Bennett via swift-evolution <swift-evolution at swift.org> wrote:
> Now, for closures, I think we should just apply the same principles. Require parentheses for the arguments, which means double parentheses (or more) are needed when unwrapping a tuple.
> In my view cognitive load is a big part of ergonomics. Reducing the rule set to a single principle seems very ergonomic to me.
More information about the swift-evolution