[swift-evolution] [Proposal][Discussion] Deprecate Tuple Shuffles

Xiaodi Wu xiaodi.wu at gmail.com
Sat May 6 01:06:17 CDT 2017


The identifier after a colon is *never* a type in any pattern matching, and
there's no need of which I'm aware to support type annotations in pattern
matching. We put colons after labels, and the current syntax is perfectly
consistent here. What is the defect you're trying to cure?
On Fri, May 5, 2017 at 22:42 Brent Royal-Gordon <brent at architechies.com>
wrote:

> Sorry for wrecking the threading, but any chance we could change the
> syntax to:
>
> let (x myX: Int, y myY: Int) = ...
>
> That would ensure the identifier after the colon was always treated as a
> type. I suppose if you wanted to infer the type, it'd be:
>
> let (x myX, y myY) = ...
>
> --
> Brent Royal-Gordon
> Sent from my iPhone
>
> On May 5, 2017, at 12:04 AM, Adrian Zubarev via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> If we ban reordering now, than I don’t see choosing different names in
> tuple destructuring as a strong argument of allowing labels there let (x:
> a, y: b). They’re literally the same as one would write comments inside
> the destructured tuple let (/* my x */ x, /* my y*/ y).
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170506/5899a939/attachment.html>


More information about the swift-evolution mailing list