Vocabulary

sequences

Inputs

Outputs

Word description

Combines successive elements of the sequence and their indices binary operations, and outputs the final result. On the first iteration, the three inputs to the quotation are identity, the first element of the sequence, and its index, 0. On successive iterations, the first input is the result of the previous iteration, the second input is the corresponding element of the sequence, and the third is its index.

Examples

Definition

sequences

Inputs

seq | a sequence |

identity | an object |

quot | a quotation with stack effect ( ... prev elt index -- ... next ) |

Outputs

result | an object |

Word description

Combines successive elements of the sequence and their indices binary operations, and outputs the final result. On the first iteration, the three inputs to the quotation are identity, the first element of the sequence, and its index, 0. On successive iterations, the first input is the result of the previous iteration, the second input is the corresponding element of the sequence, and the third is its index.

Examples

USING: sequences prettyprint math ;
{ 10 50 90 } 0 [ + + ] reduce-index .

153

153

Definition

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.99 x86.64 (2190, heads/master-e7774d1475, Feb 7 2023 20:18:26)