CLCS

Satisfying a One-Argument Test

When using one of the functions in Figure 17–3, 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 Satisfying a Two-Argument Test, but rather on the basis of a one argument predicate.

assoc-ifmember-ifrassoc-if
assoc-if-notmember-if-notrassoc-if-not
count-ifnsubst-ifremove-if
count-if-notnsubst-if-notremove-if-not
delete-ifnsubstitute-ifsubst-if
delete-if-notnsubstitute-if-notsubst-if-not
find-ifposition-ifsubstitute-if
find-if-notposition-if-notsubstitute-if-not
Figure 17–3: Operators that have One-Argument Tests to be Satisfied

The element E_i 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 E_i as an argument, and yielding an object Z_i to be used for comparison. (If there is no :key argument, Z_i is E_i.)

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, Z_i. An E_i 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, Z_i. An E_i is said to satisfy the test if this :test function returns a generalized boolean representing false.