Handbook
Glossary
each-subseq ( ... seq quot: ( ... subseq -- ... ) -- ... )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
quot
a
quotation
Outputs
None
Word description
Call
quot
for every subsequence of
seq
.
Definition
USING:
kernel
ranges
sequences
;
IN:
sequences.extras
:
each-subseq
( ... seq quot: ( ... subseq -- ... ) -- ... )
[
dup
length
[
[0..b]
]
[
]
bi
]
dip
[
[
subseq
]
]
dip
[
call
]
curry
compose
[
[
rot
]
]
dip
[
keep
]
curry
compose
[
[
[
dup
]
]
dip
[
(a..b]
]
curry
compose
]
dip
[
with
each
]
curry
compose
each
drop
;
inline