Skip to content

Conversation

airspeedswift
Copy link
Member

No description provided.

@hartbit
Copy link
Contributor

hartbit commented May 23, 2017

I dearly missed this yesterday. Any plans on getting it through review?

@Coeur
Copy link
Contributor

Coeur commented Jun 21, 2017

@airspeedswift

  • Preference would go for symmetry naming with filter: after all, it is not named filterAll. So a simple remove will do.

  • Introducing a mutating implementation for the removal job to be optimal means we could also introduce a mutating variant of filter with optimized results.

For the two reasons above, following conventions, I would go with:

// new in swift 4
public mutating func remove(_ isExcluded: (Element) throws -> Bool) rethrows
// new in swift 4
public mutating func filter(_ isIncluded: (Element) throws -> Bool) rethrows
// new in swift 4
public func removed(_ isExcluded: (Element) throws -> Bool) rethrows -> [Element]
// renamed from swift 3 `filter`
public func filtered(_ isIncluded: (Element) throws -> Bool) rethrows -> [Element]

@tkremenek
Copy link
Member

We discussed this in the Core Team meeting and this needs an implementation to be considered for review.

@DougGregor DougGregor added the workgroup: needs implementation This proposal needs more implementation work before it can be reviewed label Aug 16, 2017
@airspeedswift airspeedswift removed the workgroup: needs implementation This proposal needs more implementation work before it can be reviewed label Aug 31, 2017
@dabrahams dabrahams changed the title removeAll proposal Add remove(where:) to the Standard Library Nov 15, 2017
* Proposal: [SE-NNNN](NNNN-filename.md)
* Authors: [Ben Cohen](https://github.com/airspeedswift)
* Review Manager: TBD
* Status: **Awaiting review**

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should include a link to the implementation PR I think.

@rjmccall rjmccall merged commit d737800 into swiftlang:master Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants