Vocabulary
splitting

Inputs
seqa sequence
quota quotation with stack effect ( ... elt -- ... ? )


Outputs
before-slicea slice
after-slicea slice


Word description
Splits seq at the first occurrence of an element for which quot gives a true output and outputs the pieces before and after the split as slices. If subseq does not occur in seq, then before is just seq and after is f.

Definition


: split1-when-slice
( ... seq quot: ( ... elt -- ... ? ) -- ... before-slice after-slice )
[ snip-slice ] (split1-when) ; inline