Handbook
Glossary
nspread ( quots n -- quot )
Factor handbook
»
The language
»
Combinators
»
Generalized shuffle words and combinators
»
Generalized combinators
Prev:
ncleave ( quots n -- quot )
Next:
cleave* ( n -- quot )
Vocabulary
generalizations
Inputs
quots
a sequence of quotations
n
an
integer
Outputs
None
Word description
A generalization of
spread
that can work for any quotation arity.
Definition
USING:
kernel
sequences
;
IN:
generalizations
MACRO:
nspread
( quots n -- quot )
over
empty?
[
2drop
[
]
]
[
[
[
but-last
]
dip
]
[
[
last
]
dip
]
2bi
swap
[
[
nspread
]
2curry
]
2dip
[
[
ndip
]
2curry
]
dip
compose
]
if
;