Short-circuit combinators
Factor handbook » The language » Combinators

Prev:Compositional combinators
Next:Smart combinators


The combinators.short-circuit vocabulary stops a computation early once a condition is met.

AND combinators:
0&& ( quots -- ? )

1&& ( obj quots -- ? )

2&& ( obj1 obj2 quots -- ? )

3&& ( obj1 obj2 obj3 quots -- ? )


OR combinators:
0|| ( quots -- ? )

1|| ( obj quots -- ? )

2|| ( obj1 obj2 quots -- ? )

3|| ( obj1 obj2 obj3 quots -- ? )


Generalized combinators:
n&& ( quots n -- quot )

n|| ( quots n -- quot )