[swift-evolution] [pitch] Eliminate the "T1 -> T2" syntax, require "(T1) -> T2"

Andrey Tarantsov andrey at tarantsov.com
Fri Apr 15 02:47:28 CDT 2016


Chris,

> Given all this, I think it makes sense to go for syntactic uniformity between parameter list and function types, and just require parenthesis on the argument list.  The types above can be trivially written as:
> 
>  (Int) -> Float
>  (String) -> ()

I don't care about this particular question too much, although I still prefer less parenthesis where possible.

But I fear that going this way, we'll soon arrive at requiring parenthesis for the block arguments:

do_something { foo in 
  ...
}

and that (the parenthesis in blocks) is something I would love to avoid.

Note how all of your arguments would apply to the blocks as well.

A.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160415/ea43e613/attachment.html>


More information about the swift-evolution mailing list