bi-curry* ( x y p q -- p' q' )
Factor handbook » The language » Combinators » Compositional combinators » Curried dataflow combinators

Prev:tri-curry ( x p q r -- p' q' r' )
Next:tri-curry* ( x y z p q r -- p' q' r' )


Vocabulary
kernel

Inputs
xan object
yan object
pa quotation with stack effect ( x -- ... )
qa quotation with stack effect ( y -- ... )


Outputs
p'[ x p ]
q'[ y q ]


Word description
Partially applies p to x, and q to y.

Notes
The following two lines are equivalent:
[ p ] [ q ] bi-curry* [ call ] bi@ [ p ] [ q ] bi*

The combination bi-curry* bi is equivalent to a stack shuffle preceding 2bi*:
[ p ] [ q ] bi-curry* bi [ over ] dip [ p ] [ q ] 2bi*

In other words, bi-curry* bi handles the case where you have the three values a b c on the stack, and you wish to apply p to a b and q to a c.

The combination bi-curry* bi* is equivalent to a stack shuffle preceding 2bi*:
[ p ] [ q ] bi-curry* bi* [ swap ] dip [ p ] [ q ] 2bi*

In other words, bi-curry* bi* handles the case where you have the four values a b c d on the stack, and you wish to apply p to a c and q to b d.

Definition