> On Apr 26, 2017, at 11:44 PM, gs. via swift-evolution 
> <[email protected]> wrote:
> +1 with a small concern
> 
> 'This version will forward to the free function.'
> 
> Is that a mistake? Wouldn't the free function forward to the added method?

I'm not sure why this is there.  The implementation of the method is not part 
of the library specification.  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.

Anyway, the free function can't forward to the method, it has to handle cases 
that have nothing to do with collections.

John.

> 
> TJ 
> 
> On Apr 26, 2017, at 16:33, Xiaodi Wu via swift-evolution 
> <[email protected] <mailto:[email protected]>> wrote:
> 
>> On Wed, Apr 26, 2017 at 6:02 PM, Howard Lovatt <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 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."
>> 
>> 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:
>> 
>> "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."
>> 
>> Yes, for arrays. I use it to swap two variables `a` and `b`.
>> 
>> ```
>> var a = 1
>> var b = 2
>> swap(&a, &b)
>> ```
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> [email protected] <mailto:[email protected]>
>> https://lists.swift.org/mailman/listinfo/swift-evolution 
>> <https://lists.swift.org/mailman/listinfo/swift-evolution>
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to