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

Adrian Zubarev adrian.zubarev at devandartist.com
Fri May 5 02:04:44 CDT 2017


Personally I don’t see the latter as an issue, at least not in that particular example of yours, because you can always look up the type of your labeled tuple.

Is there any benefit gained from labels in tuple destructuring? let (x: x, y: y) is redundant to my eyes. 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).



-- 
Adrian Zubarev
Sent with Airmail

Am 5. Mai 2017 um 08:36:20, Xiaodi Wu via swift-evolution (swift-evolution at swift.org) schrieb:

```
let tuple = (x: 1, y: 2)

// I, silly human, mistakenly think the elements in the tuple are
// `y` first, then `x`. I'm a confused human. Now I write:

let (y: y, x: x) = tuple
// Currently, does the right thing, even though I'm confused.

let (y: y, x: x) = tuple
// Without tuple reordering, this produces an error, which corrects my confusion.

let (y, x) = tuple
// Oops. I'm out of luck.
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170505/3fec0a88/attachment.html>


More information about the swift-evolution mailing list