Mixed-Modes-of-Interaction.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
  2. <html>
  3. <!-- Created on December 10, 2012 by texi2html 1.82
  4. texi2html was written by:
  5. Lionel Cons <[email protected]> (original author)
  6. Karl Berry <[email protected]>
  7. Olaf Bachmann <[email protected]>
  8. and many others.
  9. Maintained by: Many creative people.
  10. Send bugs and suggestions to <[email protected]>
  11. -->
  12. <head>
  13. <title>avram - a virtual machine code interpreter: 2.6.4.3 Mixed Modes of Interaction</title>
  14. <meta name="description" content="avram - a virtual machine code interpreter: 2.6.4.3 Mixed Modes of Interaction">
  15. <meta name="keywords" content="avram - a virtual machine code interpreter: 2.6.4.3 Mixed Modes of Interaction">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="texi2html 1.82">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <style type="text/css">
  21. <!--
  22. a.summary-letter {text-decoration: none}
  23. blockquote.smallquotation {font-size: smaller}
  24. pre.display {font-family: serif}
  25. pre.format {font-family: serif}
  26. pre.menu-comment {font-family: serif}
  27. pre.menu-preformatted {font-family: serif}
  28. pre.smalldisplay {font-family: serif; font-size: smaller}
  29. pre.smallexample {font-size: smaller}
  30. pre.smallformat {font-family: serif; font-size: smaller}
  31. pre.smalllisp {font-size: smaller}
  32. span.roman {font-family:serif; font-weight:normal;}
  33. span.sansserif {font-family:sans-serif; font-weight:normal;}
  34. ul.toc {list-style: none}
  35. -->
  36. </style>
  37. </head>
  38. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  39. <a name="Mixed-Modes-of-Interaction"></a>
  40. <table cellpadding="1" cellspacing="1" border="0">
  41. <tr><td valign="middle" align="left">[<a href="Character-Oriented-Interaction.html#Character-Oriented-Interaction" title="Previous section in reading order"> &lt; </a>]</td>
  42. <td valign="middle" align="left">[<a href="Virtual-Code-Semantics.html#Virtual-Code-Semantics" title="Next section in reading order"> &gt; </a>]</td>
  43. <td valign="middle" align="left"> &nbsp; </td>
  44. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  45. <td valign="middle" align="left">[<a href="Output-From-Interactive-Applications.html#Output-From-Interactive-Applications" title="Up section"> Up </a>]</td>
  46. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  47. <td valign="middle" align="left"> &nbsp; </td>
  48. <td valign="middle" align="left"> &nbsp; </td>
  49. <td valign="middle" align="left"> &nbsp; </td>
  50. <td valign="middle" align="left"> &nbsp; </td>
  51. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  52. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  53. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  54. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  55. </tr></table>
  56. <hr size="1">
  57. <a name="Mixed-Modes-of-Interaction-1"></a>
  58. <h4 class="subsubsection">2.6.4.3 Mixed Modes of Interaction</h4>
  59. <p>An application is not confined exclusively to line oriented or character
  60. oriented interaction, but may switch from one style to the other between
  61. iterations, and signal its choice simply by the format of the data
  62. structure it returns. If the <var>prompt strings</var> field is non-empty,
  63. the interaction is line oriented, and if the field is empty, the
  64. interaction is character oriented. A function using both styles has to
  65. be prepared for whichever type of data it indicates, either a character or
  66. a list of character strings as the case may be.
  67. </p>
  68. <p>Another alternative is possible if the function returns a data structure
  69. in the form <code>(<var>files</var>,nil)</code>. This structure includes neither a
  70. list of command lines nor a list of prompt strings, empty or otherwise,
  71. but does include a list of quadruples in the <var>files</var> field. The
  72. quadruples are of the form
  73. <code>((<var>overwrite</var>,<var>path</var>),(<var>preamble</var>,<var>contents</var>))</code>.
  74. The fields have the same interpretations as in the output from a
  75. non-interactive parameter mode application, as described in
  76. <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.
  77. </p>
  78. <p>As an interactive application is able cause the execution of arbitrary
  79. shell commands, it doesn&rsquo;t need <code>avram</code> to write files for it the
  80. way a non-interactive application does, so this feature does not provide
  81. any additional capabilities. However, it may be helpful as a matter of
  82. convenience.
  83. </p>
  84. <p>After the files are written, the function will be applied to the same
  85. result it returned, <code>(<var>files</var>,nil)</code>. There is no direct means
  86. of preserving unconstrained state information from previous iterations
  87. in this style of interaction. A likely scenario might therefore be that
  88. the function returns a file list after finishing its other business, and
  89. then returns <code>nil</code> on the next iteration to terminate.
  90. </p>
  91. <hr size="1">
  92. <table cellpadding="1" cellspacing="1" border="0">
  93. <tr><td valign="middle" align="left">[<a href="Character-Oriented-Interaction.html#Character-Oriented-Interaction" title="Previous section in reading order"> &lt; </a>]</td>
  94. <td valign="middle" align="left">[<a href="Virtual-Code-Semantics.html#Virtual-Code-Semantics" title="Next section in reading order"> &gt; </a>]</td>
  95. <td valign="middle" align="left"> &nbsp; </td>
  96. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  97. <td valign="middle" align="left">[<a href="Output-From-Interactive-Applications.html#Output-From-Interactive-Applications" title="Up section"> Up </a>]</td>
  98. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  99. <td valign="middle" align="left"> &nbsp; </td>
  100. <td valign="middle" align="left"> &nbsp; </td>
  101. <td valign="middle" align="left"> &nbsp; </td>
  102. <td valign="middle" align="left"> &nbsp; </td>
  103. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  104. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  105. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  106. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  107. </tr></table>
  108. <p>
  109. <font size="-1">
  110. This document was generated on <i>December 10, 2012</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
  111. </font>
  112. <br>
  113. </p>
  114. </body>
  115. </html>