[swift-evolution] [Pitch] [Stage 2] [Additional] Remove leading dot after closures
Xiaodi Wu
xiaodi.wu at gmail.com
Sun Aug 28 22:17:28 CDT 2016
What problem are you trying to solve by proposing this change? It seems
like it would get very confusing to read, so without a compelling use case
I don't think this would be a good idea.
Further, more often than not, chained closures like this are on separate
lines (at least how I use them, which I don't think is rare), and this
change could not possibly work in that coding style. This means that if
your proposal were adopted, the resulting code would be more brittle
because a newline would break the code where previously it didn't. So I'd
be -1 for this change.
In any case, sugar is really low on the list of priorities, even for the
next stage of Swift evolution. Let's focus our attention on the priorities
already identified for this release, which would be a *huge* advancement if
they get accomplished.
On Sun, Aug 28, 2016 at 1:15 PM, Adrian Zubarev via swift-evolution <
swift-evolution at swift.org> wrote:
> This is a small pitch for stage 2 (or even another Swift release, if the
> community likes this change).
>
> We all love the trailing closure plus the ability to execute the next
> method with another trailing closure.
>
> someArray.map { … }.filter { … }.flatMap { … }
>
> Wouldn’t be great if we could remove the leading . after the trailing
> closure to get similar syntax to if bool { … } else { … }?
>
> someArray.map { … } filter { … } flatMap { … }
>
>
>
> --
> Adrian Zubarev
> Sent with Airmail
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160828/feaf1bd0/attachment.html>
More information about the swift-evolution
mailing list