[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 2.5.1.2 Standard Output Representation

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 ‘`--raw-output`’ and ‘`--choice-of-output`’, which are mutually exclusive.

- If neither option is selected, the result returned by the function must be a list of character strings.
- If ‘`--raw-output`’ 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 File Format.
- If ‘`--choice-of-output`’ is used, the result returned by the function must be a pair `(preamble,contents)`.

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 `nil`, 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.

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 `avram` on behalf of whatever application uses the file.

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 ‘`--choice-of-output`’ option than by implementing the algorithm in Concrete Syntax, from scratch in virtual code.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated on November 8, 2012 using texi2html 1.82.