split-when-slice ( ... seq quot: ( ... elt -- ... ? ) -- ... pieces ) (original) (raw)
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
seq | a sequence |
---|---|
quot | a quotation with stack effect ( ... elt -- ... ? ) |
Outputs
pieces | a 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
USING: sequences.private splitting.private ;
: split-when-slice
( ... seq quot: ( ... elt -- ... ? ) -- ... pieces )
[ ] (split) ; inline