Handbook
Glossary
(split-harvest) ( ... seq quot: ( ... elt -- ... ? ) slice-quot -- ... pieces )
Vocabulary
splitting
.
extras
.
private
Inputs
seq
an
object
quot
a
quotation
with stack effect
( ... elt -- ... ? )
slice-quot
an
object
Outputs
pieces
an
object
Definition
USING:
kernel
math
sequences
;
IN:
splitting.extras.private
::
(split-harvest)
( ... seq quot: ( ... elt -- ... ? ) slice-quot -- ... pieces )
seq
[
quot
call
not
]
find
drop
[
[
[
seq quot
find-from
drop
]
1check
[
seq
length
]
unless*
dup
]
[
f
f
f
]
if*
]
[
[
seq slice-quot
call
]
1check
[
1
+
seq
[
quot
call
not
]
find-from
drop
]
dip
]
produce
2nip
;
inline