(split*) ( ... seq quot: ( ... elt -- ... ? ) slice-quot -- ... pieces )


Vocabulary
splitting.extras.private

Inputs
seqan object
quota quotation with stack effect ( ... elt -- ... ? )
slice-quotan object


Outputs
piecesan object


Definition


:: (split*)
( ... seq quot: ( ... elt -- ... ? ) slice-quot -- ... pieces )
0
[ [ seq quot find-from drop dup ] keep -rot ] [
2dup = [ [ 1 + ] when seq slice-quot call ] 2keep
[ 1 + ] when swap
] produce nip swap seq length [ dupd < ] keep
[ seq slice-quot call suffix ] curry [ drop ] if ; inline