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

Product sequences

Product sequences

Prev: | product-map>assoc ( ... sequences quot: ( ... seq -- ... key value ) exemplar -- ... assoc ) |

Next: | product-find ( ... sequences quot: ( ... seq -- ... ? ) -- ... sequence ) |

Vocabulary

sequences.product

Inputs

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

sequences.product

Inputs

sequences | a sequence |

quot | a 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 start-product-iter :> ( ns lengths ) lengths

[ 0 = ] any? [

[ ns lengths end-product-iter? ] [

ns sequences product-nths quot call

ns lengths product-iter

] until

] unless ; inline

( ... sequences quot: ( ... seq -- ... ) -- ... )

sequences start-product-iter :> ( ns lengths ) lengths

[ 0 = ] any? [

[ ns lengths end-product-iter? ] [

ns sequences product-nths quot call

ns lengths product-iter

] until

] unless ; inline

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.100 x86.64 (2250, heads/master-3623a4e0d7, Nov 15 2023 18:16:06)