<div dir="ltr">On Fri, May 5, 2017 at 12:52 AM, Adrian Zubarev <span dir="ltr"><<a href="mailto:adrian.zubarev@devandartist.com" target="_blank">adrian.zubarev@devandartist.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="m_-2654004740070611601bloop_markdown"><p>Eliminating all labels would mean that even the first example from my last post will be banned.</p></div></div></blockquote><div>No, not eliminating all labels from tuples, but from tuple _patterns_.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="m_-2654004740070611601bloop_markdown"><p> </p>
<p>Is there any difference from labels in tuple types and labels in tuples themselves?</p>
<p>Personally I would not support the removal of labels from tuple types, because it’s a very useful feature that replaces indexed access like <code>myTuple.1</code> to a more readable counterpart <code>myTuple.somethingSpecial</code>. </p>
<p>Am I still missing something out?</p>
<p></p></div><div class="m_-2654004740070611601bloop_original_html"><span class=""><div id="m_-2654004740070611601bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div> <br> <div id="m_-2654004740070611601bloop_sign_1493963146083270144" class="m_-2654004740070611601bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div> <br></span><div><div class="h5"><p class="m_-2654004740070611601airmail_on">Am 5. Mai 2017 um 07:43:49, Xiaodi Wu (<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>) schrieb:</p> <blockquote type="cite" class="m_-2654004740070611601clean_bq"><span><div><div></div><div>
<div dir="ltr">On Fri, May 5, 2017 at 12:42 AM, Adrian Zubarev via
swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div class="m_-2654004740070611601m_-1319762173201981654bloop_markdown">
<p>Okay now I see where this is going. So basically you want to
mirror the behavior of function parameters into tuples.</p>
<p>You might want to be a little bit more explicit on types in your
proposal to better understand the so called ‘tuple shuffle’.</p>
<pre><code class="m_-2654004740070611601m_-1319762173201981654swift">let a: (x: Int, y: Int) = (x: 1, y: 2)
var b: (y: Int, x: Int) = a
a.x == b.x
a.y == b.y
</code></pre>
<p>Label swap (tuple shuffle) while destructuring:</p>
<pre><code class="m_-2654004740070611601m_-1319762173201981654swift">let tuple: (first: Int, second: (x: Int, y: Int)) = (first: 0, second: (x: 1, y: 2))
let (first: a, second: (x: b, y: c)): (first: Int, second: (x: Int, y: Int)) = tuple // fine, unaffected
let (second: (x: b, y: c), first: a): (second: (x: Int, y: Int), first: Int) = tuple // shuffle => error</code></pre></div>
</div>
</blockquote>
<div><br></div>
<div>No, I thought this was what Robert was proposing, but he is
proposing the elimination of all labels in tuple patterns. Your
second example would be banned.</div>
<div><br></div>
</div>
</div>
</div>
</div></div></span></blockquote></div></div></div><div class="m_-2654004740070611601bloop_markdown"><p></p></div></div></blockquote></div><br></div></div>