> On May 24, 2016, at 5:45 PM, Haravikk via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
>> On 24 May 2016, at 21:14, Leonardo Pessoa <m...@lmpessoa.com 
>> <mailto:m...@lmpessoa.com>> wrote:
>> 
>> My first question here would be "what's the gain?" I understand
>> CollectionTypes and arrays may be something different but I myself
>> admit I don't know and wonder how that change would be a benefit to
>> us?
> 
> Instead of functions only accepting an Array, which is a specific type, they 
> would accept any collection type, including all the lazy collections.

Among other things, one practical advantage of this is that since ArraySlice 
conforms to CollectionType, one could simply subscript an array if they wanted 
to send only a subset of its contents to a method, without having to incur the 
performance cost of creating a new array.

Charles

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to