product-each ( ... sequences quot: ( ... seq -- ... ) -- ... )
Product sequences

Prev:product-map>assoc ( ... sequences quot: ( ... seq -- ... key value ) exemplar -- ... assoc )
Next:product-find ( ... sequences quot: ( ... seq -- ... ? ) -- ... sequence )


Vocabulary
sequences.product

Inputs
sequencesa sequence
quota quotation with stack effect ( ... seq -- ... )


Outputs
None

Word description
Calls quot for every element of the cartesian product of sequences.

Notes
[ ... ] product-each is equivalent to, but more efficient than, <product-sequence> [ ... ] each.

See also
product-map, product-find

Definition


:: product-each
( ... sequences quot: ( ... seq -- ... ) -- ... )
sequences [ empty? ] any? [
sequences length f <array>
sequences >array 0 quot (product-each)
] unless ; inline