Handbook
Glossary
(split) ( seq quot: ( ... elt -- ... ? ) slice-quot -- pieces )
Vocabulary
splitting
.
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.private
:
(split)
( seq quot: ( ... elt -- ... ? ) slice-quot -- pieces )
[
0
]
3dip
pick
[
swap
curry
[
keep
1
+
swap
]
curry
[
[
find-from
drop
dup
]
2curry
[
keep
-rot
]
curry
]
dip
V{
}
produce-as
nip
]
2keep
swap
[
[
length
swapd
]
keep
]
dip
2curry
call
suffix!
{
}
like
;
inline