std-remove-if-not


Synopsis

(std-remove-if-not <pred> <lst>)

Description

STD-REMOVE-IF-NOT returns a list keeping all elements that satisfy the predicate. It is not destructive, it always returns a copy.

Remember "keep-if" instead of "remove if not"

Examples

(std-remove-if-not 'numberp '(0 1 2)) 	=> (0 1 2)
(std-remove-if-not 'zerop '(0 1 2)) 	=> (0)

Arguments

pred: a function or lambda list accepting one argument and returning either nil or non-nil.

lst: any proper list.

Return Value

A list.

Side Effects

None.

Module

(std-require 'STDLIST)

Defined in STDLIST