chickadee » integer-map » fxmapping-map

fxmapping-map proc fxmapprocedure

The proc argument of fxmapping-map is of type fixnum * → *.

Returns a fxmapping with the same keys as fxmap whose values are the result of transforming the values of fxmap with proc. For each association (k, v) in fxmap, the association (k, (proc k v)) is added to the resulting fxmapping. The dynamic order of the applications of proc to the elements of fxmap is unspecified.

Examples:

(fxmapping->alist
 (fxmapping-map (lambda (_ s) (string-length s))
                (fxmapping 0 "picard" 1 "riker" 2 "troi")))
 ⇒ ((0 . 6) (1 . 5) (2 . 4))

(fxmapping->alist
 (fxmapping-map (lambda (k s)
                  (string-append s (number->string k)))
                (fxmapping 256 "x" 512 "y" 1024 "z")))
 ⇒ ((256 . "x256") (512 . "y512") (1024 . "z1024"))