8.1. Publication

An Orc expression publishes a value when the expression produces a value to be used in the context enclosing the expression. An extremely simple example of publication is a literal, for example the expression 1, which publishes a single integer value. Orc expressions may publish zero or more values during their execution. The effect of publication depends on the context. For example, each publication of F in the sequential combinator expression F >x> G causes G to be run with x bound to the published value. An expression that never publishes is said to be silent.

The following is the publication behavior of a few common forms of Orc expressions.

8.1.1. Examples

Publish no values
(1 | 2) >> stop
{-
OUTPUT:
-}
Publish one value
1
{-
OUTPUT:
1
-}
Publish two values
(1 | 2) >x> x + 30
{-
OUTPUT:PERMUTABLE
31
32
-}
Publish an unbounded number of values (metronome)
def metronome() = signal | Rwait(1000) >> metronome()

metronome()

8.1.2. Related Links