5.40.5 Selecting elements of a list: select
The select command selects elements of a list meeting given
conditions.
- select takes two arguments:
- f, a boolean function.
- L, a list.
- select(f,L) returns the sublist of L consisting
of the elements c such that f(c)==true.
Example
Input:
select(x->(x>=2),[0,1,2,3,1,5])
Output: