<div dir="ltr">On Wed, Apr 26, 2017 at 6:02 PM, Howard Lovatt <span dir="ltr"><<a href="mailto:howard.lovatt@gmail.com" target="_blank">howard.lovatt@gmail.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">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>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>