1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <html lang="en">
- <head>
- <title>Mixed Modes of Interaction - avram - a virtual machine code interpreter</title>
- <meta http-equiv="Content-Type" content="text/html">
- <meta name="description" content="avram - a virtual machine code interpreter">
- <meta name="generator" content="makeinfo 4.13">
- <link title="Top" rel="start" href="index.html#Top">
- <link rel="up" href="Output-From-Interactive-Applications.html#Output-From-Interactive-Applications" title="Output From Interactive Applications">
- <link rel="prev" href="Character-Oriented-Interaction.html#Character-Oriented-Interaction" title="Character Oriented Interaction">
- <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
- <meta http-equiv="Content-Style-Type" content="text/css">
- <style type="text/css"><!--
- pre.display { font-family:inherit }
- pre.format { font-family:inherit }
- pre.smalldisplay { font-family:inherit; font-size:smaller }
- pre.smallformat { font-family:inherit; font-size:smaller }
- pre.smallexample { font-size:smaller }
- pre.smalllisp { font-size:smaller }
- span.sc { font-variant:small-caps }
- span.roman { font-family:serif; font-weight:normal; }
- span.sansserif { font-family:sans-serif; font-weight:normal; }
- --></style>
- </head>
- <body>
- <div class="node">
- <a name="Mixed-Modes-of-Interaction"></a>
- <p>
- Previous: <a rel="previous" accesskey="p" href="Character-Oriented-Interaction.html#Character-Oriented-Interaction">Character Oriented Interaction</a>,
- Up: <a rel="up" accesskey="u" href="Output-From-Interactive-Applications.html#Output-From-Interactive-Applications">Output From Interactive Applications</a>
- <hr>
- </div>
- <h5 class="subsubsection">2.6.4.3 Mixed Modes of Interaction</h5>
- <p>An application is not confined exclusively to line oriented or character
- oriented interaction, but may switch from one style to the other between
- iterations, and signal its choice simply by the format of the data
- structure it returns. If the <var>prompt strings</var> field is non-empty,
- the interaction is line oriented, and if the field is empty, the
- interaction is character oriented. A function using both styles has to
- be prepared for whichever type of data it indicates, either a character or
- a list of character strings as the case may be.
- <p>Another alternative is possible if the function returns a data structure
- in the form <code>(</code><var>files</var><code>,nil)</code>. This structure includes neither a
- list of command lines nor a list of prompt strings, empty or otherwise,
- but does include a list of quadruples in the <var>files</var> field. The
- quadruples are of the form
- <code>((</code><var>overwrite</var><code>,</code><var>path</var><code>),(</code><var>preamble</var><code>,</code><var>contents</var><code>))</code>.
- The fields have the same interpretations as in the output from a
- non-interactive parameter mode application, as described in
- <a href="Output-From-Non_002dinteractive-Applications.html#Output-From-Non_002dinteractive-Applications">Output From Non-interactive Applications</a>, and will cause a list of files to be written in the same way.
- <p>As an interactive application is able cause the execution of arbitrary
- shell commands, it doesn't need <code>avram</code> to write files for it the
- way a non-interactive application does, so this feature does not provide
- any additional capabilities. However, it may be helpful as a matter of
- convenience.
- <p>After the files are written, the function will be applied to the same
- result it returned, <code>(</code><var>files</var><code>,nil)</code>. There is no direct means
- of preserving unconstrained state information from previous iterations
- in this style of interaction. A likely scenario might therefore be that
- the function returns a file list after finishing its other business, and
- then returns <code>nil</code> on the next iteration to terminate.
- </body></html>
|