[swift-evolution] Adding a new filter method which returns 2 arrays

Arman Shan armanshan12 at gmail.com
Fri Jan 15 11:59:48 CST 2016


Yes. I was thinking we would just copy over the filter implementation, and it should only need a small modification to keep track of the items being filtered, and finally return 2 arrays.


> On Jan 15, 2016, at 12:11 PM, Developer <devteam.codafi at gmail.com> wrote:
> 
> If we're going to add a partition method, can the original filter be rewritten in terms of it?
> 
> ~Robert Widmann
> 
> 2016/01/15 12:07、Nate Birkholz via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> のメッセージ:
> 
>> That seems like a solid idea.
>> 
>> On Fri, Jan 15, 2016 at 8:02 AM, Arman Shanjani via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> Hi,
>> 
>> I was wondering if we could add a new filter method to the stdlib, where instead of returning just one array, it returns a tuple of 2 arrays, one with items that the closure returned true for and one with items that the closure returned false for. What do you think?
>> 
>> Thank you,
>> 
>> Arman
>> 
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>> 
>> 
>> 
>> 
>> -- 
>> Nate Birkholz
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160115/35141793/attachment.html>


More information about the swift-evolution mailing list