2tri ( x y p q r -- ) (original) (raw)

Vocabulary
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

IN: kernel

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