Top Up Prev Next Bottom Contents Index Search

7.5 An overview of DDF stars

The "open-palette" command in pigi ("O") will open a checkbox window that you can use to open the standard palettes in all of the installed domains. For the DDF domain, the star library is small enough that it is contained entirely in one palette, shown in figure

Case (Three icons.) Route an input particle to one of the outputs depending on the control particle. The control particle should be between zero and N - 1, inclusive, where N is the number of outputs.
EndCase (Three icons.) Depending on the control particle, consume a particle from one of the data inputs and send it to the output. The control particle should have value between zero and N - 1, inclusive, where N is the number of inputs.
DownCounter Given an integer input with value N, produce a sequence of output integers with values (N - 1), (N - 2), ... 1, 0.
LastOfN Given a control input with integer value N, consume N particles from the data input and produce only the last of these at the output.
Repeater Given a control input with integer value N, and a single input data particle, produce N copies of the data particle on the output.
The Higher Order Functions icon leads to the HOF palette that contains HOF stars that can be used within DDF.

Self (Five icons.) This is a first exploration of recursion and higher-order functions in dataflow. It is still experimental, so do not expect it to be either efficient or bug-free.
The star "represents" the galaxy given by the parameter recurGal, which must be above it in the hierarchy. That is, when the Self star fires, it actually invokes the galaxy that it represents. Since that galaxy is above the Self star in the hierarchy, it contains the Self star somewhere within it. Thus, this star implements recursion. Since the Self star takes an argument (recurGal) that specifies the function to invoke, it is itself a higher-order function.
The instance of the recurGal galaxy is not created until it is actually needed, so the number of instances (the depth of the recursion) does not need to be known a priori. If the parameter reinitialize is NO or FALSE, then the instance of the galaxy is created the first time it fires and reused on subsequent firings. If reinitialize is YES or TRUE, then the galaxy is created on every firing and destroyed after the firing. Inputs are sent to the instance of the galaxy and outputs are retrieved from it. The inputs of the named galaxy must be named "input#?" and the outputs must be named "output#?", where "?" is replaced with an integer starting with zero. This allows the inputs and outputs of this star to be matched unambiguously with the inputs and outputs of the referenced galaxy.

Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.