2tri ( x y p q r -- )
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
xan object
yan object
pa quotation with stack effect ( x y -- ... )
qa quotation with stack effect ( x y -- ... )
ra 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

: 2tri ( x y p q r -- ) [ [ 2keep ] dip 2keep ] dip call ;
inline