split-when-slice ( ... seq quot: ( ... elt -- ... ? ) -- ... pieces )
Factor handbook » The language » Collections » Sequence operations » Splitting sequences

Prev:split-when ( ... seq quot: ( ... elt -- ... ? ) -- ... pieces )
Next:split-lines ( seq -- seq' )


Vocabulary
splitting

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


Outputs
piecesa new array


Word description
Splits seq at each occurrence of an element for which quot gives a true output and outputs an array of pieces as slices. The pieces do not include the elements along which the sequence was split.

Definition