Spread combinators
Up:Data flow combinators, Combinators, The language, Factor handbook
Prev:Cleave combinators
Next:Apply combinators

The spread combinators apply multiple quotations to multiple values. The * suffix signifies spreading.

Two quotations:
bi* ( x y p q -- )
2bi* ( w x y z p q -- )
Three quotations:
tri* ( x y z p q r -- )
2tri* ( u v w x y z p q r -- )
An array of quotations:
spread ( objs... seq -- )
Technically, the spread combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on three related values can be written in one of two ways:
! First alternative; uses dip [ [ 1 + ] dip 1 - ] dip 2 * ! Second alternative: uses tri* [ 1 + ] [ 1 - ] [ 2 * ] tri*

A generalization of the above combinators to any number of quotations can be found in Combinators.
Expressing shuffle words with spread combinators