Handbook
Glossary
mnmap-as ( m*seq quot n*exemplar m n -- result*n )
Generalized sequence words
Prev:
mnmap ( m*seq quot m n -- result*n )
Next:
nproduce ( pred quot n -- seq... )
Vocabulary
sequences
.
generalizations
Inputs
m*seq
m
sequences on the datastack
quot
a
quotation
with stack effect
( m*element -- result*n )
n*exemplar
n
sequences on the datastack
m
an
integer
n
an
integer
Outputs
result*n
n
sequences on the datastack of the same types as the
exemplar
s
Word description
A generalization of
map-as
,
2map-as
, and
3map-as
that can map over any number of sequences in parallel and provide any number of output sequences of distinct types.
Definition
USING:
generalizations
kernel
;
IN:
sequences.generalizations
:
mnmap-as
( m*seq quot n*exemplar m n -- result*n )
dup
[
[
(neach)
]
curry
]
2dip
[
[
ndip
]
2curry
]
dip
[
nmap-integers-as
]
curry
compose
call
;
inline