[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 2.6.4 Output From Interactive Applications

Parameter mode applications invoked with either of the ‘`--interactive`’ or ‘`--step`’ options are required to take the data structure described in Input Data Structure as an argument but to return the virtual code for a function that will observe a certain protocol allowing shell commands to be executed on its behalf. The intent is that the virtual code file doesn’t contain the real application per se, but only something that builds the real one on the fly using configuration information from the input files and command line options.

The format of the result returned by an interactive application, being a virtual code application itself, requires a full exposition of the virtual machine code semantics. This subject is deferred to Virtual Code Semantics. The remainder of this section describes the protocol followed by the function returned by the interactive application rather than the application itself.

Similarly to the case of a byte transducer described in Byte Transducers, the basic pattern of interaction between `avram` and the function is a cycle of invocations. In general terms, the function is applied to a `nil` argument initially, and expected to return an initial state and initial output. Thereafter, the function is applied to a pair of the state returned on the previous iteration, and the next installment of input. The function returns further output and a new state, and the cycle continues until the function returns a value of `nil`, at which time the computation terminates.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated on November 8, 2012 using texi2html 1.82.