12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <html lang="en">
- <head>
- <title>Character Oriented 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="Line-Oriented-Interaction.html#Line-Oriented-Interaction" title="Line Oriented Interaction">
- <link rel="next" href="Mixed-Modes-of-Interaction.html#Mixed-Modes-of-Interaction" title="Mixed Modes of 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="Character-Oriented-Interaction"></a>
- <p>
- Next: <a rel="next" accesskey="n" href="Mixed-Modes-of-Interaction.html#Mixed-Modes-of-Interaction">Mixed Modes of Interaction</a>,
- Previous: <a rel="previous" accesskey="p" href="Line-Oriented-Interaction.html#Line-Oriented-Interaction">Line 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.2 Character Oriented Interaction</h5>
- <p>A character oriented style of interaction involves the function always
- returning a data structure of the form <code>(</code><var>state</var><code>,(</code><var>command
- lines</var><code>,nil))</code>. The <var>state</var> and <var>command lines</var> fields serve
- <a name="index-command-line-236"></a>exactly the same purposes respectively as they do in the case of line
- oriented interaction. The field that would be occupied by the
- <var>prompt strings</var> list in the case of line oriented interaction is
- identically <code>nil</code> in this style.
- <p>When this style is used, <code>avram</code> spawns a process and/or sends
- <a name="index-spawning-processes-237"></a>command lines to it as in the case of line oriented interaction, but
- attempts to read only a single character from it per iteration. When the
- character is received, <code>avram</code> applies the function to the pair
- <code>(</code><var>state</var><code>,</code><var>character</var><code>)</code> in order to obtain the next state
- and the next list of command lines. If the process has terminated, a
- <code>nil</code> value is used in place of the character. If the process is
- quiescent, deadlock ensues.
- <p>The character oriented style is a lower level protocol that shifts more
- of the burden of analyzing the process's output to the virtual code
- application. It can do anything line oriented interaction can do except
- proceeding immediately without waiting to receive any output from the
- process. It may also allow more general criteria (in effect) than the
- matching of a fixed prompt string to delimit the received data, for
- those pathological processes that may require such things.
- <p>Applications using character oriented interaction need to deal with line
- <a name="index-line-breaks-238"></a>breaks explicitly among the received characters, unlike the case with
- line oriented interaction, where the line breaks are implicit in the
- <a name="index-Unix-239"></a>list of received strings. Contrary to the convention for Unix text
- files, line breaks in the output of a process are indicated by character
- code 13 followed by character code 10.
- </body></html>
|