chickadee » srfi-217 » iset-partition

iset-partition predicate isetprocedure

Returns two values: a newly allocated iset that contains just the elements of iset that satisfy predicate and another newly allocated iset that contains just the elements of iset that do not satisfy predicate.

Example:

   (let-values (((low high) (iset-partition (lambda (x) (< x 6))
                                            (iset 2 3 5 7 11))))
     (list (iset->list low) (iset->list high)))
    ⇒ ((2 3 5) (7 11))