Handbook
Glossary
product-sequence
Product sequences
Next:
<product-sequence> ( sequences -- product-sequence )
Vocabulary
sequences
.
product
Class description
A class of virtual sequences that present the cartesian product of their underlying set of sequences. Product sequences are constructed with the
<product-sequence>
word.
Examples
USING: arrays prettyprint sequences.product ; { { 1 2 3 } { "a" "b" "c" } } <product-sequence> >array .
{ { 1 "a" } { 1 "b" } { 1 "c" } { 2 "a" } { 2 "b" } { 2 "c" } { 3 "a" } { 3 "b" } { 3 "c" } }
See also
<product-sequence>
Definition
USING:
arrays
;
IN:
sequences.product
TUPLE:
product-sequence
{
sequences
array
read-only
initial:
{
}
}
{
lengths
array
read-only
initial:
{
}
}
;
Methods
USING:
accessors
sequences
sequences.product
;
M:
product-sequence
length
lengths>>
product
;
USING:
accessors
kernel
sequences
sequences.product
sequences.product.private
;
M:
product-sequence
nth
[
lengths>>
product-ns
]
[
sequences>>
product-nths
]
bi
;