[Review] SE-0066: Standardize function type argument syntax to require parentheses


(Thorsten Seitz) #1

• What is your evaluation of the proposal?

I am against it. For me requiring parentheses around single arguments is just visual clutter.

An alternative for eliminating the ambiguities would be to require parentheses around

- single tuple arguments

- multiple arguments

Int -> Int // single non-tuple argument, no parentheses required

(Int, Int) -> Int // multiple arguments, parentheses required

((Int, Int)) -> Int // single tuple argument, parentheses required

=> No ambiguities anymore.

• Is the problem being addressed significant enough to warrant a change to Swift?

The ambiguity should be solved, but I'd prefer an alternative solution (see above).

• Does this proposal fit well with the feel and direction of Swift?

No, it introduces visual clutter which is IMHO unnecessary. Additionally it creates a slippery slope as there have already been voices to require parentheses around argument lists of closure expressions, just for consistency reasons, although there is not even an ambiguity problem (if parentheses would be prohibited there except for tuples).

• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

Haskell does not need parentheses at all as all functions there are conceptually one argument functions, so it is not a fair comparison.

• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

I read the proposal, and followed the discussion.

-Thorsten