chickadee » integer-map » fxmapping-partition

fxmapping-partition pred fxmapprocedure

Returns two fxmappings: the first contains all associations of fxmap that satisfy pred (in the sense of fxmapping-find), and the second contains those that do not.

Example:

(let-values (((pos ~pos)
              (fxmapping-partition (lambda (_ v) (positive? v))
                                   (fxmapping 0 2 1 -4 2 8 3 -16))))
  (values (fxmapping->alist pos)
          (fxmapping->alist ~pos)))
 ⇒ ((0 . 2) (2 . 8))
   ((1 . -4) (3 . -16))