Handbook
Glossary
sequence-cartesian-product ( seqs -- seqs' )
Vocabulary
sequences
.
extras
Inputs
seqs
an
object
Outputs
seqs'
an
object
Definition
USING:
arrays
kernel
math
sequences
;
IN:
sequences.extras
:
sequence-cartesian-product
( seqs -- seqs' )
dup
length
1
<=
[
[
[
1array
]
map
]
map
concat
]
[
2
cut
[
first2
cartesian-product
concat
]
dip
swap
[
[
suffix
]
cartesian-map
concat
]
reduce
]
if
;