next up previous contents index
Next: MemoryBlock Up: ListType Previous: sort!   Contents   Index


split!


Usage

split!(l, f)


Signature

split!: (%,T $\to$ Boolean) $\to$ (%,%)


Parameter Type Description
l % a list
f T $\to$ Boolean a predicate


Returns

Returns sublists $l_t$ and $l_f$ of l such that $l_t$ is the list of elements of l for which f is true, and $l_f$ is the list of elements of l for which f is false.


Remarks

split! does not make a copy of l, which is therefore destroyed after the call. No new list is created by split!, but the elements of l are relinked into $l_t$ and $l_f$.



Manuel Bronstein 2004-06-28