[swift-evolution] [pitch] Adding in-place removeAll to the std lib

David Sweeris davesweeris at mac.com
Sun Apr 9 21:43:08 CDT 2017


> On Apr 8, 2017, at 12:03, Ben Cohen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> 
> Hi swift-evolution,
> 
> Another short proposal related to the Collection algorithms theme, this time for removing elements in-place from a collection.
> 
> Online copy here: https://github.com/airspeedswift/swift-evolution/blob/1aac5593828941431d1805503865e7a2913d538b/proposals/NNNN-RemoveWhere.md

I don't think the `foo.removeAll(equalTo: 3)` is sufficiently better than `foo.removeAll { $0 == 3}` to justify the alternate spelling.

+1, regardless, though.

- Dave Sweeris 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170409/27b3e206/attachment.html>


More information about the swift-evolution mailing list