What is a flow-function?

Here is the xml schema code fragment for flow-function.
<xs:complexType mixed="false" name="flowfunction">
 <xs:sequence>
	<xs:element name="comment" type="o:commenttype" minOccurs="0" maxOccurs="1" />
	<xs:element name="output" type="o:outputtype" minOccurs="0" maxOccurs="unbounded" />
 </xs:sequence>
 <xs:attribute name="note" use="optional" type="xs:string"/>
</xs:complexType>

A flow-function is a recognition of the fact that in programming, different structures of control flow are often strongly related to specific classes of function. For instance, the if-then-else construct (known as a conditional) is often affiliated with testing or comparing values.

In Obyx, we have tied the flow structure with the functions that commonly occur with them, by declaring the specific function that controls the flow as the 'operation' attribute of each of the language's four flow-functions.

Initially this may look like Obyx is losing orthogonality by doing this; but things are a bit more complex - we have to remember that structurally xml is tree-based, so using the structure of the tree does not limit us - we can nest whatever function we like, and also it is not possible to separate the treelike nature of a declaration, so using a flow that most accords with it is, in most cases, highly intuitive. Nesting is not just bracketing!

More specifically, 'flow-function' is an abstract template for iteration, instruction, mapping and comparison elements. Being an abstract template, flow-function only exists in Obyx as the common values extended by the flow-function elements.

Instances of the flow-function template are Iteration, Instruction, Comparison and Mapping.

All flow functions may have any number of outputs. If output is omitted the default output with space="immediate" is assumed. If no output is required, then one needs to specify the output with space="none"

The 'note' attribute is available as standard flow-function attributes. It allows for simple comments, and the notes will appear in traces.

flow-function



Last Modified: Thu, 15 Jan 2015