PageRenderTime 2ms CodeModel.GetById 53ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/doc/avram.html/Error-Messages.html

https://github.com/gueststar/Avram
HTML | 182 lines | 146 code | 12 blank | 24 comment | 0 complexity | d1cb23cd60c954916b0967f7fd27c15f MD5 | raw file
  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
  4texi2html was written by: 
  5            Lionel Cons <Lionel.Cons@cern.ch> (original author)
  6            Karl Berry  <karl@freefriends.org>
  7            Olaf Bachmann <obachman@mathematik.uni-kl.de>
  8            and many others.
  9Maintained by: Many creative people.
 10Send bugs and suggestions to <texi2html-bug@nongnu.org>
 11-->
 12<head>
 13<title>avram - a virtual machine code interpreter: 2.7.15.3 Error Messages</title>
 14
 15<meta name="description" content="avram - a virtual machine code interpreter: 2.7.15.3 Error Messages">
 16<meta name="keywords" content="avram - a virtual machine code interpreter: 2.7.15.3 Error Messages">
 17<meta name="resource-type" content="document">
 18<meta name="distribution" content="global">
 19<meta name="Generator" content="texi2html 1.82">
 20<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 21<style type="text/css">
 22<!--
 23a.summary-letter {text-decoration: none}
 24blockquote.smallquotation {font-size: smaller}
 25pre.display {font-family: serif}
 26pre.format {font-family: serif}
 27pre.menu-comment {font-family: serif}
 28pre.menu-preformatted {font-family: serif}
 29pre.smalldisplay {font-family: serif; font-size: smaller}
 30pre.smallexample {font-size: smaller}
 31pre.smallformat {font-family: serif; font-size: smaller}
 32pre.smalllisp {font-size: smaller}
 33span.roman {font-family:serif; font-weight:normal;}
 34span.sansserif {font-family:sans-serif; font-weight:normal;}
 35ul.toc {list-style: none}
 36-->
 37</style>
 38
 39
 40</head>
 41
 42<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
 43
 44<a name="Error-Messages"></a>
 45<table cellpadding="1" cellspacing="1" border="0">
 46<tr><td valign="middle" align="left">[<a href="Operator-Generalization.html#Operator-Generalization" title="Previous section in reading order"> &lt; </a>]</td>
 47<td valign="middle" align="left">[<a href="Expedient-Error-Messages.html#Expedient-Error-Messages" title="Next section in reading order"> &gt; </a>]</td>
 48<td valign="middle" align="left"> &nbsp; </td>
 49<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>
 50<td valign="middle" align="left">[<a href="Exception-Handling.html#Exception-Handling" title="Up section"> Up </a>]</td>
 51<td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
 52<td valign="middle" align="left"> &nbsp; </td>
 53<td valign="middle" align="left"> &nbsp; </td>
 54<td valign="middle" align="left"> &nbsp; </td>
 55<td valign="middle" align="left"> &nbsp; </td>
 56<td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
 57<td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
 58<td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
 59<td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
 60</tr></table>
 61<hr size="1">
 62<a name="Error-Messages-1"></a>
 63<h4 class="subsubsection">2.7.15.3 Error Messages</h4>
 64
 65<p>The basic strategy for representing the results of exceptional
 66conditions arising from the evaluation of operands on a given level of
 67the hierarchy will be to use an error message corresponding to the image
 68of a list of character strings on the level above.
 69</p>
 70<p>Unfortunately, the official <code>silly</code> standard does not
 71define character constants, but they are available as a vendor specific
 72extension in <code>silly-me</code> (millennium edition), where character strings
 73<a name="index-silly_002dme"></a>
 74<a name="index-strings-2"></a>
 75<a name="index-character-strings-3"></a>
 76may be enclosed in single quotes. The value of the semantic
 77<a name="index-semantic-function-1"></a>
 78function [[&hellip;]] in the case of a character string is the list
 79of representations of the characters, based on <a href="Character-Table.html#Character-Table">Character Table</a>
 80and <a href="Representation-of-Numeric-and-Textual-Data.html#Representation-of-Numeric-and-Textual-Data">Representation of Numeric and Textual Data</a>.
 81</p>
 82<p>For the sake of consistency, each standard error message is a list of
 83character strings, even though the list has only one string in it. If
 84any exceptional condition is the result of a computation, it is written
 85to standard error by <code>avram</code> as the list of character strings it
 86represents.
 87</p>
 88<dl compact="compact">
 89<dt> <em>P45</em></dt>
 90<dd><p>([[<code>compare</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid comparison',nil)</code>]]<code>_(<var>n</var>+1)</code>
 91</p></dd>
 92<dt> <em>P46</em></dt>
 93<dd><p>([[<code>left</code>]] <code>nil</code>)<code>_<var>n</var></code>  = [[<code>('invalid deconstruction',nil)</code>]]<code>_(<var>n</var>+1)</code>
 94</p></dd>
 95<dt> <em>P47</em></dt>
 96<dd><p>([[<code>right</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(<var>n</var>+1)</code>
 97</p></dd>
 98<dt> <em>P48</em></dt>
 99<dd><p>(([[<code>fan</code>]] <code><var>f</var></code>)
100<code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(<var>n</var>+1)</code>
101</p></dd>
102<dt> <em>P49</em></dt>
103<dd><p>([[<code>member</code>]] <code>nil</code>)<code>_<var>n</var></code>  = [[<code>('invalid membership',nil)</code>]]<code>_(<var>n</var>+1)</code>
104</p></dd>
105<dt> <em>P50</em></dt>
106<dd><p>([[<code>distribute</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid distribution',nil)</code>]]<code>_(<var>n</var>+1)</code>
107</p></dd>
108<dt> <em>P51</em></dt>
109<dd><p>([[<code>cat</code>]] <code>nil</code>)<code>_<var>n</var></code>  = [[<code>('invalid concatenation',nil)</code>]]<code>_(<var>n</var>+1)</code>
110</p></dd>
111<dt> <em>P52</em></dt>
112<dd><p>([[<code>meta</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid recursion',nil)</code>]]<code>_(<var>n</var>+1)</code>
113</p></dd>
114</dl>
115
116<p>Note that by virtue of property <em>P44</em>, there is no need for an
117application to make explicit checks for exceptional results at any
118point, because the exceptional result propagates through to the output
119of any function composed with the one that incurred it. For example, an
120application of the form <code>h = compose(f,right)</code>, which will cause an
121invalid deconstruction error if applied in filter mode to an empty file,
122imposes no requirement that <code>f</code> be written to accommodate that
123possibility (i.e., by checking for it) in order for the error to be
124reported properly. The following proof demonstrates that the meaning of <code>f</code>
125is irrelevant to the result.
126</p><table><tr><td>&nbsp;</td><td><pre class="format">[[<code>compose(f,right)</code>]]<code>_0</code> <code>nil_0</code>
127
128   = [[<code>f</code>]]<code>_0</code> [[<code>right</code>]]<code>_0</code> <code>nil</code><code>_0</code>
129
130   = [[<code>f</code>]]<code>_0</code> [[<code>('invalid deconstruction',nil)</code>]]<code>_1</code>
131
132   = [[<code>('invalid deconstruction',nil)</code>]]<code>_1</code>
133</pre></td></tr></table>
134
135<p>In an application <code>h = compose(f,g)</code>, the input
136validation therefore may be confined to the &ldquo;front end&rdquo;, <code>g</code>.
137</p>
138<p>It will be recalled from the discussions of <code>recur</code> (<a href="Recur.html#Recur">Recur</a>)
139<a name="index-recur-1"></a>
140<a name="index-transpose-1"></a>
141and <code>transpose</code> (<a href="Transpose.html#Transpose">Transpose</a>) that the semantics of
142virtual code involving these forms is defined in terms of the
143<code>field</code> format for deconstruction functions (<a href="Field.html#Field">Field</a>),
144<a name="index-field-2"></a>
145which depends implicitly on the semantics of <code>left</code> and
146<code>right</code>, being a generalization of them. An invalid deconstruction
147<a name="index-left-2"></a>
148<a name="index-right-3"></a>
149message could therefore result from applications incorporating any of
150the forms of <code>recur</code>, <code>transpose</code>, or <code>field</code>. Invalid
151deconstructions could also arise from the <code>replace</code> operation
152<a name="index-replace-1"></a>
153<a name="index-assignment-1"></a>
154(<a href="Replace.html#Replace">Replace</a>), which is used for assignment (<a href="Assignment.html#Assignment">Assignment</a>), because
155<code>replace</code> is defined by virtual code, except as noted next.
156</p>
157<hr size="1">
158<table cellpadding="1" cellspacing="1" border="0">
159<tr><td valign="middle" align="left">[<a href="Operator-Generalization.html#Operator-Generalization" title="Previous section in reading order"> &lt; </a>]</td>
160<td valign="middle" align="left">[<a href="Expedient-Error-Messages.html#Expedient-Error-Messages" title="Next section in reading order"> &gt; </a>]</td>
161<td valign="middle" align="left"> &nbsp; </td>
162<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>
163<td valign="middle" align="left">[<a href="Exception-Handling.html#Exception-Handling" title="Up section"> Up </a>]</td>
164<td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
165<td valign="middle" align="left"> &nbsp; </td>
166<td valign="middle" align="left"> &nbsp; </td>
167<td valign="middle" align="left"> &nbsp; </td>
168<td valign="middle" align="left"> &nbsp; </td>
169<td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
170<td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
171<td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
172<td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
173</tr></table>
174<p>
175 <font size="-1">
176  This document was generated on <i>December 10, 2012</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
177 </font>
178 <br>
179
180</p>
181</body>
182</html>