[swift-evolution] Additional methods for removing elements from a collection in Swift

Jonathan Hull jhull at gbis.com
Tue Sep 26 05:15:53 CDT 2017


> On Sep 26, 2017, at 2:37 AM, Alwyn Concessao <alsav196 at yahoo.com> wrote:
> 
> @Jonathan Hull - You've mentioned  about splitting a list using a filter which returns the filtered list and the remainder.Is it similar to having a filter function which does the filtering on the original collection and also returns the elements which are removed from the collection?

Hmm… I suppose a remove(where:) that had a @discardableResult of the things being removed would be useful in this way.  Not to mention that it would be consistent with what I expect from a function called remove.

I was already in support, but now even more so…

Thanks,
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170926/f92befc6/attachment.html>


More information about the swift-evolution mailing list