<div>I use:</div><div><br></div><div> (b, a) = (a, b)</div><div><br></div><div>So I wouldn't miss it.</div><div><br><div class="gmail_quote"><div>On Thu, 27 Apr 2017 at 9:33 am, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com">xiaodi.wu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Wed, Apr 26, 2017 at 6:02 PM, Howard Lovatt <span><<a href="mailto:howard.lovatt@gmail.com" target="_blank">howard.lovatt@gmail.com</a>></span> wrote:<br></div><div><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">Regarding: "Source compatibility is a serious goal now. There's no harm in the current `swap`, and I use it. This is no rationale for breaking existing code."<br>
<br>
Swap for arrays will have to go when ARC controls come in. You can't pass two parts of the same array to one function. The relevant bit from the Ownership manifesto is:<br>
<br>
"Accessing a component of a value type through a subscript is treated as accessing the entire value, and so is considered to overlap any other access to the value."<br></blockquote><div><br></div></div></div></div><div><div class="gmail_extra"><div class="gmail_quote"><div>Yes, for arrays. I use it to swap two variables `a` and `b`.</div><div><br></div><div>```</div><div>var a = 1</div><div>var b = 2</div><div>swap(&a, &b)</div><div>```</div><div><br></div></div></div></div>
</blockquote></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature">-- Howard.</div>