When using one of the functions in the next figure, the elements E of a sequence S are filtered not on the basis of the presence or absence of an object O under a two argument predicate, as with the functions described in Section 17.2.1 (Satisfying a Two-Argument Test), but rather on the basis of a one argument predicate.
|
Figure 17.3: Operators that have One-Argument Tests to be Satisfied
The element Ei might not be considered directly. If a :key argument is provided, it is a designator for a function of one argument to be called with each Ei as an argument, and yielding an object Zi to be used for comparison. (If there is no :key argument, Zi is Ei.)
Functions defined in this specification and having a name that
ends in “-if
” accept a first argument that is a designator for a
function of one argument, Zi.
An Ei is said to satisfy the test if this :test function
returns a generalized boolean representing true.
Functions defined in this specification and having a name that
ends in “-if-not
” accept a first argument that is a designator for a
function of one argument, Zi.
An Ei is said to satisfy the test if this :test function
returns a generalized boolean representing false.
(count-if #'zerop '(1 #C(0.0 0.0) 0 0.0d0 0.0s0 3)) → 4 (remove-if-not #'symbolp '(0 1 2 3 4 5 6 7 8 9 A B C D E F)) → (A B C D E F) (remove-if (complement #'symbolp) '(0 1 2 3 4 5 6 7 8 9 A B C D E F)) → (A B C D E F) (count-if #'zerop '("foo" "" "bar" "" "" "baz" "quux") :key #'length) → 3