[swift-evolution] [pitch] Eliminate the "T1 -> T2" syntax, require "(T1) -> T2"
jtbandes at gmail.com
Tue Apr 19 18:28:37 CDT 2016
On Tue, Apr 19, 2016 at 3:29 PM, Dave Abrahams via swift-evolution <
swift-evolution at swift.org> wrote:
> on Tue Apr 19 2016, Alan Skipp <swift-evolution at swift.org> wrote:
> > I’d place the ability to omit parenthesises for single args in the same
> > as being able to omit `self` when accessing properties. They are small
> > conveniences that make a large difference to an entire codebase.
> Care to back that up with some measurements? Take one of your projects
> and find the instances of “[^) ] *->”
> How many places in the code are affected, and how much worse is the result?
Here's one data point: including a small handful of false positives, I
found 74 results in a project with 33 Swift files.
"How much worse" is hard to answer. It certainly wouldn't be the worst
thing in the world to add parens, but I'm not particularly compelled by the
pro-() arguments in this thread.
> > On 19 Apr 2016, at 15:49, Erica Sadun via swift-evolution
> > <swift-evolution at swift.org> wrote:
> > Apart from intuition and confusion, parentheses are used at call
> > and declarations. It seems out of line that they can be removed in
> > but only in one degenerate case.
> > This goes against the Swift core design goal of consistency.
> > -- E
> > _______________________________________________
> > swift-evolution mailing list
> > swift-evolution at swift.org
> > https://lists.swift.org/mailman/listinfo/swift-evolution
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution