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.101 x86.64 (2284, heads/master-ca11a5b440, Nov 4 2024 19:38:46)