chickadee » integer-map » fxmapping-count

fxmapping-count pred fxmapprocedure

pred is a predicate of type fixnum * → boolean.

Returns the number of associations in fxmap that satisfy pred (in the sense of fxmapping-find).

Examples:

(fxmapping-count (lambda (_ v) (even? v))
                 (fxmapping 0 1 1 2 2 4 3 8)) ⇒ 3
(fxmapping-count (lambda (k s) (= k (string-length s)))
                 (fxmapping 0 "x" 1 "y" 2 "z"))
 ⇒ 1