Next: , Previous: , Up: vectors   [Index]


24.5 Predicates

Function: vector-null? obj

Return #t if obj is the empty vector, otherwise return #f.

Function: %vector-every pred vec start past
Function: %vector-any pred vec start past
Macro: subvector-every pred V
Macro: subvector-any pred V

Check to see if the given predicate is true on every/any item in vec, proceeding from left (index start) to right (index past). If the selected subvector is empty, the return value is #f.

The predicate is “witness–generating”:

If the predicate is applied to the final item of the selected subvector, that final application is a tail call.

The names of these procedures do not end with a question mark; this is to indicate that they do not return a simple boolean (#t or #f), but a general value.

Function: vector-every pred vec0 vec ...
Function: vector-any pred vec0 vec ...

Like subvector-every and subvector-any, but apply the predicate to the elements of all the vectors used as arguments. All the arguments must have the same number of elements.