[swift-evolution] Deprecating Trailing Closures
David Sweeris
davesweeris at mac.com
Fri Mar 25 07:56:07 CDT 2016
Agreed.
Sent from my iPhone
On Mar 25, 2016, at 07:44, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>>> let foo = myArray
>>> .filter { $0 & 1 == 1 }
>>> .map { $0 + 1 }
>>> .reduce(0) { $0 + $1 }
>>
>> This doesn’t really seem much neater or more readable to me than:
>>
>> let foo = myArray
>> .filter({ $0 & 1 == 1 })
>> .map({ $0 + 1 })
>> .reduce(0, { $0 + $1 })
>
> I, on the other hand, cannot imagine how you would not see a difference between the two. The paren-less form is *far* more readable to me; when you put a parenthesis and a curly bracket next to each other, the curly bracket disappears and I can no longer see that the expression is a closure.
>
> Swift generally doesn't mandate any particular style. I think this is a good time to continue that tradition.
>
> --
> Brent Royal-Gordon
> Architechies
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list