common-lisp has functions called remove-if-not (applicative) and delete-if-not (destructive version).
The spec says that [t]he functions delete-if-not and remove-if-not are deprecated.
But all that is wrong is their double negative name. remove-if-not is precisely the same thing as keep-if, which is too useful to deprecate. Numerous languages have a function like this, sometimes called filter or similar.
The spec says that [t]he functions delete-if-not and remove-if-not are deprecated.
But all that is wrong is their double negative name. remove-if-not is precisely the same thing as keep-if, which is too useful to deprecate. Numerous languages have a function like this, sometimes called filter or similar.