The pruning combinator is used to block a computation waiting for a result from another computation, and/or to terminate a computation. 


{{{E <P< E}}}

!Associativity: Left

The pruning combinator is left associative: F <x< G <y< H is equivalent to (F <x< G) <y< H. 

!Precedence: [parallel | Parallel] > pruning > otherwise

The pruning combinator has lower precedence than the parallel combinator: F <x< G | H is equivalent to F <x< (G | H).

The execution of F <x< G starts by executing F and G in parallel. Whenever F publishes a value, that value is published by the entire execution. When G publishes its first value, that value is bound to x in F, and then the execution of G is immediately [terminated | ExampleTerminatedReferencePage]. 

During the execution of F, any part of the execution that depends on x will be [suspended | ExampleSuspensionReferencePage] until x is bound (to the first value published by G). 

The pruning combinator may include a full pattern P instead of just a variable name. Any value published by G is matched against the pattern P. If this match is successful, then G terminates and all of the bindings of the pattern P are made in F. Otherwise, the published value is simply ignored and G continues to execute.


[{orc runnable='false'

-- Publish either 5 or 6, but not both
x+2 <x< (3 | 4)


[{orc runnable='false'

-- Query Google and Yahoo for a search result
-- Print out the result that arrives first; ignore the other result
println(result) <result< ( Google("cupcake") | Yahoo("cupcake") )