chickadee » vector-lib » vector-count

vector-count pred? vec_1 vec_2 ···procedure

Counts the number of parallel elements in the vectors that satisfy pred?, which is applied, for each index i in the range [0, length) — where length is the length of the smallest vector argument —, to i and each parallel element in the vectors at that index, in order.

Examples:

(vector-count (λ (i elt) (even? elt))
              '#(3 1 4 1 5 9 2 5 6))
  ;=> 3
(vector-count (λ (i x y) (< x y))
              '#(1 3 6 9)
              '#(2 4 6 8 10 12))
  ;=> 2