Mixed-Modes-of-Interaction.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <html lang="en">
  2. <head>
  3. <title>Mixed Modes of Interaction - 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="Output-From-Interactive-Applications.html#Output-From-Interactive-Applications" title="Output From Interactive Applications">
  9. <link rel="prev" href="Character-Oriented-Interaction.html#Character-Oriented-Interaction" title="Character Oriented Interaction">
  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="Mixed-Modes-of-Interaction"></a>
  27. <p>
  28. Previous:&nbsp;<a rel="previous" accesskey="p" href="Character-Oriented-Interaction.html#Character-Oriented-Interaction">Character Oriented Interaction</a>,
  29. Up:&nbsp;<a rel="up" accesskey="u" href="Output-From-Interactive-Applications.html#Output-From-Interactive-Applications">Output From Interactive Applications</a>
  30. <hr>
  31. </div>
  32. <h5 class="subsubsection">2.6.4.3 Mixed Modes of Interaction</h5>
  33. <p>An application is not confined exclusively to line oriented or character
  34. oriented interaction, but may switch from one style to the other between
  35. iterations, and signal its choice simply by the format of the data
  36. structure it returns. If the <var>prompt strings</var> field is non-empty,
  37. the interaction is line oriented, and if the field is empty, the
  38. interaction is character oriented. A function using both styles has to
  39. be prepared for whichever type of data it indicates, either a character or
  40. a list of character strings as the case may be.
  41. <p>Another alternative is possible if the function returns a data structure
  42. in the form <code>(</code><var>files</var><code>,nil)</code>. This structure includes neither a
  43. list of command lines nor a list of prompt strings, empty or otherwise,
  44. but does include a list of quadruples in the <var>files</var> field. The
  45. quadruples are of the form
  46. <code>((</code><var>overwrite</var><code>,</code><var>path</var><code>),(</code><var>preamble</var><code>,</code><var>contents</var><code>))</code>.
  47. The fields have the same interpretations as in the output from a
  48. non-interactive parameter mode application, as described in
  49. <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.
  50. <p>As an interactive application is able cause the execution of arbitrary
  51. shell commands, it doesn't need <code>avram</code> to write files for it the
  52. way a non-interactive application does, so this feature does not provide
  53. any additional capabilities. However, it may be helpful as a matter of
  54. convenience.
  55. <p>After the files are written, the function will be applied to the same
  56. result it returned, <code>(</code><var>files</var><code>,nil)</code>. There is no direct means
  57. of preserving unconstrained state information from previous iterations
  58. in this style of interaction. A likely scenario might therefore be that
  59. the function returns a file list after finishing its other business, and
  60. then returns <code>nil</code> on the next iteration to terminate.
  61. </body></html>