Output-From-Interactive-Applications.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <html lang="en">
  2. <head>
  3. <title>Output From Interactive Applications - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="Parameter-Mode-Interface.html#Parameter-Mode-Interface" title="Parameter Mode Interface">
  9. <link rel="prev" href="Output-From-Non_002dinteractive-Applications.html#Output-From-Non_002dinteractive-Applications" title="Output From Non-interactive Applications">
  10. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  11. <meta http-equiv="Content-Style-Type" content="text/css">
  12. <style type="text/css"><!--
  13. pre.display { font-family:inherit }
  14. pre.format { font-family:inherit }
  15. pre.smalldisplay { font-family:inherit; font-size:smaller }
  16. pre.smallformat { font-family:inherit; font-size:smaller }
  17. pre.smallexample { font-size:smaller }
  18. pre.smalllisp { font-size:smaller }
  19. span.sc { font-variant:small-caps }
  20. span.roman { font-family:serif; font-weight:normal; }
  21. span.sansserif { font-family:sans-serif; font-weight:normal; }
  22. --></style>
  23. </head>
  24. <body>
  25. <div class="node">
  26. <a name="Output-From-Interactive-Applications"></a>
  27. <p>
  28. Previous:&nbsp;<a rel="previous" accesskey="p" href="Output-From-Non_002dinteractive-Applications.html#Output-From-Non_002dinteractive-Applications">Output From Non-interactive Applications</a>,
  29. Up:&nbsp;<a rel="up" accesskey="u" href="Parameter-Mode-Interface.html#Parameter-Mode-Interface">Parameter Mode Interface</a>
  30. <hr>
  31. </div>
  32. <h4 class="subsection">2.6.4 Output From Interactive Applications</h4>
  33. <p><a name="index-g_t_0040code_007binteractive_007d-command-line-option-228"></a><a name="index-g_t_0040code_007bstep_007d-command-line-option-229"></a>Parameter mode applications invoked with either of the
  34. <samp><span class="option">--interactive</span></samp> or <samp><span class="option">--step</span></samp> options are
  35. required to take the data structure described in <a href="Input-Data-Structure.html#Input-Data-Structure">Input Data Structure</a> as an
  36. argument but to return the virtual code for a function that will observe
  37. <a name="index-shell-230"></a>a certain protocol allowing shell commands to be executed on its
  38. behalf. The intent is that the virtual code file doesn't contain the
  39. real application <em>per se</em>, but only something that builds the real
  40. one on the fly using configuration information from the input files and
  41. command line options.
  42. <p>The format of the result returned by an interactive application, being a
  43. virtual code application itself, requires a full exposition of the
  44. virtual machine code semantics. This subject is deferred to <a href="Virtual-Code-Semantics.html#Virtual-Code-Semantics">Virtual Code Semantics</a>.
  45. The remainder of this section describes the protocol followed by the
  46. function returned by the interactive application rather than the
  47. application itself.
  48. <p>Similarly to the case of a byte transducer described in <a href="Byte-Transducers.html#Byte-Transducers">Byte Transducers</a>,
  49. the basic pattern of interaction between <code>avram</code> and the function
  50. is a cycle of invocations. In general terms, the function is applied to
  51. a <code>nil</code> argument initially, and expected to return an initial state
  52. and initial output. Thereafter, the function is applied to a pair of the
  53. state returned on the previous iteration, and the next installment of
  54. input. The function returns further output and a new state, and the
  55. cycle continues until the function returns a value of <code>nil</code>, at
  56. which time the computation terminates.
  57. <ul class="menu">
  58. <li><a accesskey="1" href="Line-Oriented-Interaction.html#Line-Oriented-Interaction">Line Oriented Interaction</a>
  59. <li><a accesskey="2" href="Character-Oriented-Interaction.html#Character-Oriented-Interaction">Character Oriented Interaction</a>
  60. <li><a accesskey="3" href="Mixed-Modes-of-Interaction.html#Mixed-Modes-of-Interaction">Mixed Modes of Interaction</a>
  61. </ul>
  62. </body></html>