chickadee » srfi-116 » ipartition

ipartition pred ilistprocedure

Partitions the elements of ilist with predicate pred, and returns two values: the ilist of in-elements and the ilist of out-elements. The ilist is not disordered — elements occur in the result ilists in the same order as they occur in the argument ilist. The dynamic order in which the various applications of pred are made is not specified. One of the returned ilists may share a common tail with the argument ilist.

(ipartition symbol? (iq one 2 3 four five 6))
 ;=> (one four five)
 ;=> (2 3 6)