list keep - part-cw/lambdanative GitHub Wiki
(list-keep lst cnd)
list-keep returns list element(s) that meet condition.
Parameter | Description |
---|---|
lst | List to operate on |
cnd | Condition for a list item to be kept |
Example
Example 1: Retrieve all values <=3 from a list
> (list-keep (list 7 1 8 2 9 3 2 5) (lambda (l) (<= l 3)))
(1 2 3 2)