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@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.
```
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to