Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Eliminate elements from a list for which a given conditional is True
ResourceFunction["Discard"][list, crit] discards elements of list for which crit[elem] gives True. | |
ResourceFunction["Discard"][crit] is an operator form of ResourceFunction["Discard"] that can be applied to an expression. |
Discard all primes from a list of integers:
In[1]:= |
Out[1]= |
If crit[elem] does not explicitly evaluate to False, elem is kept:
In[2]:= |
Out[2]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License