Handbook
Glossary
monotonic-split-impl ( seq quot slice-quot n -- pieces )
Vocabulary
splitting
.
monotonic
.
private
Inputs
seq
an
object
quot
an
object
slice-quot
an
object
n
an
object
Outputs
pieces
an
object
Definition
USING:
kernel
math
sequences
;
IN:
splitting.monotonic.private
::
monotonic-split-impl
( seq quot slice-quot n -- pieces )
V{
}
clone
:>
accum 0 0 seq
[
]
[
[
1
+
]
2dip
[
quot
call
[
[
seq slice-quot
call
accum
push
]
keep
dup
]
unless
]
keep
]
map-reduce
drop
n
=
[
drop
]
[
n seq slice-quot
call
accum
push
]
if
accum
{
}
like
;
inline