2tri ( x y p q r -- )

Factor handbook » The language » Combinators » Dataflow combinators » Cleave combinators

Factor handbook » The language » Combinators » Dataflow combinators » Cleave combinators

Prev: | tri ( x p q r -- ) |

Next: | 3tri ( x y z p q r -- ) |

Vocabulary

kernel

Inputs

Outputs

None

Word description

Applies p to the two input values, then applies q to the two input values, and finally applies r to the two input values.

Examples

If [ p ], [ q ] and [ r ] have stack effect ( x y -- ), then the following two lines are equivalent:

In general, the following two lines are equivalent:

Definition

kernel

Inputs

x | an object |

y | an object |

p | a quotation with stack effect ( x y -- ... ) |

q | a quotation with stack effect ( x y -- ... ) |

r | a quotation with stack effect ( x y -- ... ) |

Outputs

None

Word description

Applies p to the two input values, then applies q to the two input values, and finally applies r to the two input values.

Examples

If [ p ], [ q ] and [ r ] have stack effect ( x y -- ), then the following two lines are equivalent:

[ p ] [ q ] [ r ] 2tri
2dup p 2dup q r

In general, the following two lines are equivalent:

[ p ] [ q ] [ r ] 2tri
[ p ] 2keep [ q ] 2keep r

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.100 x86.64 (2240, heads/master-b90c89f82e, Sep 26 2023 19:59:25)