next up previous contents
Next: Continuing Operators Up: Grouping Operators Together Previous: Grouping Operators Together

Multiple Operators

  Of course, an application can't always guarantee that it will use operators sequentially, so a construct is needed in the language that indicates that a group of operators may be used in any order. This is expressed with the parallel construct. For example, if there are three specific `root' nodes that broadcast at unpredictable times, the COP description might be


\begin{singlespace}
\begin{verbatim}
(parallel
 (broadcast 'b0 0)
 (broadcast 'b1 7)
 (broadcast 'b2 12))\end{verbatim} \end{singlespace}

Operators appearing within a parallel construct must be scheduled into a single phase to allow the application to use them all unpredictably. The parallel construct is thus more restrictive than the sequential construct, since the COP compiler is free to treat a sequential as a parallel, but not the reverse.

An alternate form of the parallel command is available as a macro which can parameterize multiple instances of a parallel command. The doall command takes a variable specification (in the same form as a let statement, with list values for the variables), and converts it into a parallel command by concatenating the results of evaluating the body with the variables bound to all combinations of their list members in turn.



Back to Chris Metcalf's home page