1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <html lang="en">
- <head>
- <title>Standard Output Representation - 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="Loading-All-of-Standard-Input-at-Once.html#Loading-All-of-Standard-Input-at-Once" title="Loading All of Standard Input at Once">
- <link rel="prev" href="Standard-Input-Representation.html#Standard-Input-Representation" title="Standard Input Representation">
- <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="Standard-Output-Representation"></a>
- <p>
- Previous: <a rel="previous" accesskey="p" href="Standard-Input-Representation.html#Standard-Input-Representation">Standard Input Representation</a>,
- Up: <a rel="up" accesskey="u" href="Loading-All-of-Standard-Input-at-Once.html#Loading-All-of-Standard-Input-at-Once">Loading All of Standard Input at Once</a>
- <hr>
- </div>
- <h5 class="subsubsection">2.5.1.2 Standard Output Representation</h5>
- <p><a name="index-standard-output-187"></a><a name="index-g_t_0040code_007braw_002doutput_007d-command-line-option-188"></a><a name="index-g_t_0040code_007bchoice_002dof_002doutput_007d-command-line-option-189"></a>As in the case of standard input, the representation for standard output
- that the function is expected to return depends on the command line
- options with which the application is invoked. The only relevant options
- are <samp><span class="option">--raw-output</span></samp> and <samp><span class="option">--choice-of-output</span></samp>, which are
- mutually exclusive.
- <ul>
- <li>If neither option is selected, the result returned by the function must
- be a list of character strings.
- <li>If <samp><span class="option">--raw-output</span></samp> is used, the result returned by the
- function is unconstrained, and it will be written as a data file with no
- preamble, following the format specified in <a href="File-Format.html#File-Format">File Format</a>.
- <li>If <samp><span class="option">--choice-of-output</span></samp> is used, the result returned by the
- function must be a pair <code>(</code><var>preamble</var><code>,</code><var>contents</var><code>)</code>.
- </ul>
- <p><a name="index-preamble-190"></a>In the last case, the preamble determines how the file will be written.
- If it is meant to be a text file, the preamble should be <code>nil</code>, and
- the contents should be a list of character strings. If it is meant to be
- a data file, the preamble should be a non-empty list of character
- strings, and the format of the contents is unconstrained. To express a
- data file with no preamble, the preamble should be the list containing
- the empty string, rather than being empty.
- <p>In the result returned by the function, the preamble lines should not
- include leading hash characters, because they are automatically added to
- the output to enforce consistency with the data file format. However,
- they should include trailing backslashes as continuation characters
- where appropriate. The hashes that are automatically added will be
- automatically stripped by <code>avram</code> on behalf of whatever application
- uses the file.
- <p><a name="index-character-strings-191"></a><a name="index-printing-algorithm-192"></a>Any file can be written as a list of character strings, even “text”
- files that are full of unprintable characters, and even “text” files
- that happen to conform to the format used for data files. However, if
- the application intends to write a data file in the standard format used
- by other virtual code applications, it can do so more quickly and easily
- by having the virtual machine do the formatting automatically with the
- <samp><span class="option">--choice-of-output</span></samp> option than by implementing the algorithm in
- <a href="Concrete-Syntax.html#Concrete-Syntax">Concrete Syntax</a>, from scratch in virtual code.
- </body></html>
|