A variable may occur on its own as an expression. Execution of a variable publishes the value bound to that variable, and then halts.
The variable might be executed before it is bound to a value. This could occur if the variable was introduced by a pruning combinator, or if it is the name of a defined function whose body contains unbound variables. In this case, execution of that variable blocks until the variable is bound.
If the variable was introduced by a pruning combinator, and the right side of that combinator halts before the variable becomes bound, execution of the variable also halts.
The type of a variable expression is the type given to it by the current typing context.
{- Publish the values bound to two variables. One of the bindings occurs only after some time has passed, so execution of that variable blocks. -} val x = 0 val y = Rwait(1000) >> 1 x | y {- OUTPUT: 0 1 -}
Related Reference Topics
Related Tutorial Sections