2dip ( x y quot -- x y )
Factor handbook » The language » Combinators » Dataflow combinators » Preserving combinators

Prev:dip ( x quot -- x )
Next:3dip ( x y z quot -- x y z )


Vocabulary
kernel

Inputs
xan object
yan object
quota quotation


Outputs
xan object
yan object


Word description
Removes x and y from the datastack, calls quot, and restores the removed objects to the top of the datastack when quot is finished.

Notes
The following are equivalent:
[ [ foo bar ] dip ] dip

[ foo bar ] 2dip


Definition

: 2dip ( x y quot -- x y ) swap [ dip ] dip ;