You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
Documentation says:
The name
remove_if
strongly suggests that elements satisfying the predicate will be removed, keeping only those that do not satisfy the predicate; whilefilter
actually keeps the elements satisfying the predicate.In other words, the linguistic expectation would be that
remove_if
is sugar forfilter(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.)The text was updated successfully, but these errors were encountered: