Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove_if name misleading #46

Open
yurikhan opened this issue Mar 14, 2018 · 0 comments
Open

remove_if name misleading #46

yurikhan opened this issue Mar 14, 2018 · 0 comments
Milestone

Comments

@yurikhan
Copy link

Documentation says:

fun.remove_if(predicate, gen, param, state)
iterator:remove_if(predicate)

An alias for filter().

The name remove_if strongly suggests that elements satisfying the predicate will be removed, keeping only those that do not satisfy the predicate; while filter actually keeps the elements satisfying the predicate.

In other words, the linguistic expectation would be that remove_if is sugar for filter(function(x) return not p(x) end).

(Of course it’s your call how to solve this without breaking existing code if any. I’d suggest deprecating the remove_if name for a while.)

@kyukhin kyukhin added this to the wishlist milestone Oct 15, 2021
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

No branches or pull requests

2 participants