<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Apr 26, 2017, at 11:44 PM, gs. via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div dir="auto" class=""><div class=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">+1 with a small concern</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">'This version will forward to the free function.'</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Is that a mistake? Wouldn't the free function forward to the added method?</span></div></div></div></div></blockquote><div><br class=""></div>I'm not sure why this is there. &nbsp;The implementation of the method is not part of the library specification. &nbsp;If it forwards to the free function for some reason, it'll be via internal implementation details that certainly don't need to be described in this proposal.<br class=""><div><br class=""></div>Anyway, the free function can't forward to the method, it has to handle cases that have nothing to do with collections.</div><div><br class=""></div><div>John.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class="">TJ&nbsp;</span></div></div><div class=""><br class="">On Apr 26, 2017, at 16:33, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">On Wed, Apr 26, 2017 at 6:02 PM, Howard Lovatt <span dir="ltr" class="">&lt;<a href="mailto:howard.lovatt@gmail.com" target="_blank" class="">howard.lovatt@gmail.com</a>&gt;</span> wrote:<br class=""><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 class="">
<br class="">
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 class="">
<br class="">
"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 class=""></blockquote><div class=""><br class=""></div><div class="">Yes, for arrays. I use it to swap two variables `a` and `b`.</div><div class=""><br class=""></div><div class="">```</div><div class="">var a = 1</div><div class="">var b = 2</div><div class="">swap(&amp;a, &amp;b)</div><div class="">```</div><div class=""><br class=""></div></div></div></div>
</div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>