<div>-1 here. What&#39;s wrong with tuples? Don&#39;t kill functional approach</div><div><br><div class="gmail_quote"><div>On Wed, 28 Dec 2016 at 19:35 Micah Hainline via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg">You haven&#39;t really explained what problem this solves, and it would have to be a pretty big one to justify such a change.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I&#39;m -1 on this, until a compelling argument is made. This feels like just liking the syntax of another language and wanting it in Swift.</div></div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">On Dec 28, 2016, at 5:09 AM, Anton Zhilin via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="m_5871273881087162446markdown-here-wrapper gmail_msg"><p style="margin:0px 0px 1.2em!important" class="gmail_msg">Some people on the list wondered, why we have moved from tuples in function parameters, but multiple returns are still implemented using tuples? The following code still compiles:</p><br><br><pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class="gmail_msg"><code class="m_5871273881087162446hljs m_5871273881087162446language-swift gmail_msg" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="m_5871273881087162446hljs-func gmail_msg"><span class="m_5871273881087162446hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">func</span> <span class="m_5871273881087162446hljs-title gmail_msg" style="color:rgb(153,0,0);font-weight:bold">position</span><span class="m_5871273881087162446hljs-params gmail_msg">()</span> -&gt; <span class="m_5871273881087162446hljs-params gmail_msg">(x: Int, y: Int)</span> </span>{<br><br>    <span class="m_5871273881087162446hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">return</span> (x: <span class="m_5871273881087162446hljs-number gmail_msg" style="color:rgb(0,128,128)">0</span>, y: <span class="m_5871273881087162446hljs-number gmail_msg" style="color:rgb(0,128,128)">0</span>)<br><br>}<br><br><br><br><span class="m_5871273881087162446hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">let</span> (y, x) = position()<br><br></code></pre><br><br><p style="margin:0px 0px 1.2em!important" class="gmail_msg">(Maybe it’s a bad example, because naturally we’d use <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">Point</code> struct. Let’s pretend those two parameters don’t make sense as a struct.)</p><br><br><p style="margin:0px 0px 1.2em!important" class="gmail_msg">What I want to discuss is if we should introduce <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">out</code> parameters <strong class="gmail_msg">and</strong> make them the default for multiple returns for Swift 4. The syntax would look like:</p><br><br><pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class="gmail_msg"><code class="m_5871273881087162446hljs m_5871273881087162446language-swift gmail_msg" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="m_5871273881087162446hljs-func gmail_msg"><span class="m_5871273881087162446hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">func</span> <span class="m_5871273881087162446hljs-title gmail_msg" style="color:rgb(153,0,0);font-weight:bold">position</span><span class="m_5871273881087162446hljs-params gmail_msg">(x: out Int, y: out Int)</span> </span>{<br><br>    x = <span class="m_5871273881087162446hljs-number gmail_msg" style="color:rgb(0,128,128)">0</span><br><br>    y = <span class="m_5871273881087162446hljs-number gmail_msg" style="color:rgb(0,128,128)">0</span><br><br>}<br><br><br><br><span class="m_5871273881087162446hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">var</span> y<br><br>position(x: <span class="m_5871273881087162446hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">let</span> x, y: y)<br><br></code></pre><br><br><p style="margin:0px 0px 1.2em!important" class="gmail_msg"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">out</code> arguments can be any patterns allowed on the left side of assignment, including wildcard pattern and tuple destructuring pattern.</p><br><br><div title="MDH:PGRpdj5Tb21lIHBlb3BsZSBvbiB0aGUgbGlzdCB3b25kZXJlZCwgd2h5IHdlIGhhdmUgbW92ZWQg&lt;br&gt;&lt;br&gt;ZnJvbSB0dXBsZXMgaW4gZnVuY3Rpb24gcGFyYW1ldGVycywgYnV0IG11bHRpcGxlIHJldHVybnMg&lt;br&gt;&lt;br&gt;YXJlIHN0aWxsIGltcGxlbWVudGVkIHVzaW5nIHR1cGxlcz8gVGhlIGZvbGxvd2luZy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XY+ZnVuYyBw&lt;br&gt;&lt;br&gt;b3NpdGlvbih4OiBvdXQgSW50LCB5OiBvdXQgSW50KSB7PC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7&lt;br&gt;&lt;br&gt;IHggPSAwPC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7IHkgPSAwPC9kaXY+PGRpdj59PC9kaXY+PGRp&lt;br&gt;&lt;br&gt;dj48YnI+PC9kaXY+PGRpdj52YXIgeTwvZGl2PjxkaXY+cG9zaXRpb24oeDogbGV0IHgsIHk6IHkp&lt;br&gt;&lt;br&gt;PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PmBvdXRgIGFyZ3VtZW50cyBj&lt;br&gt;&lt;br&gt;YW4gYmUgYW55IHBhdHRlcm5zIGFsbG93ZWQgb24gdGhlIGxlZnQgc2lkZSBvZiBhc3NpZ25tZW50&lt;br&gt;&lt;br&gt;LCBpbmNsdWRpbmcgd2lsZGNhcmQgcGF0dGVybiBhbmQgdHVwbGUgZGVzdHJ1Y3R1cmluZyBwYXR0&lt;br&gt;&lt;br&gt;ZXJuLjxicj48L2Rpdj4=" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0" class="gmail_msg">​</div></div></div><br><br></div></blockquote><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><span class="gmail_msg">_______________________________________________</span><br class="gmail_msg"><span class="gmail_msg">swift-evolution mailing list</span><br class="gmail_msg"><span class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a></span><br class="gmail_msg"><span class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class="gmail_msg"></div></blockquote></div>_______________________________________________<br class="gmail_msg"><br>swift-evolution mailing list<br class="gmail_msg"><br><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"><br></blockquote></div></div>