PageRenderTime 39ms CodeModel.GetById 16ms 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
Possible License(s): GPL-3.0, GPL-2.0
  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 <Lionel.Cons@cern.ch> (original author)
  6. Karl Berry <karl@freefriends.org>
  7. Olaf Bachmann <obachman@mathematik.uni-kl.de>
  8. and many others.
  9. Maintained by: Many creative people.
  10. Send 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. <meta name="description" content="avram - a virtual machine code interpreter: 2.7.15.3 Error Messages">
  15. <meta name="keywords" content="avram - a virtual machine code interpreter: 2.7.15.3 Error Messages">
  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="Error-Messages"></a>
  40. <table cellpadding="1" cellspacing="1" border="0">
  41. <tr><td valign="middle" align="left">[<a href="Operator-Generalization.html#Operator-Generalization" title="Previous section in reading order"> &lt; </a>]</td>
  42. <td valign="middle" align="left">[<a href="Expedient-Error-Messages.html#Expedient-Error-Messages" 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="Exception-Handling.html#Exception-Handling" 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="Error-Messages-1"></a>
  58. <h4 class="subsubsection">2.7.15.3 Error Messages</h4>
  59. <p>The basic strategy for representing the results of exceptional
  60. conditions arising from the evaluation of operands on a given level of
  61. the hierarchy will be to use an error message corresponding to the image
  62. of a list of character strings on the level above.
  63. </p>
  64. <p>Unfortunately, the official <code>silly</code> standard does not
  65. define character constants, but they are available as a vendor specific
  66. extension in <code>silly-me</code> (millennium edition), where character strings
  67. <a name="index-silly_002dme"></a>
  68. <a name="index-strings-2"></a>
  69. <a name="index-character-strings-3"></a>
  70. may be enclosed in single quotes. The value of the semantic
  71. <a name="index-semantic-function-1"></a>
  72. function [[&hellip;]] in the case of a character string is the list
  73. of representations of the characters, based on <a href="Character-Table.html#Character-Table">Character Table</a>
  74. and <a href="Representation-of-Numeric-and-Textual-Data.html#Representation-of-Numeric-and-Textual-Data">Representation of Numeric and Textual Data</a>.
  75. </p>
  76. <p>For the sake of consistency, each standard error message is a list of
  77. character strings, even though the list has only one string in it. If
  78. any exceptional condition is the result of a computation, it is written
  79. to standard error by <code>avram</code> as the list of character strings it
  80. represents.
  81. </p>
  82. <dl compact="compact">
  83. <dt> <em>P45</em></dt>
  84. <dd><p>([[<code>compare</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid comparison',nil)</code>]]<code>_(<var>n</var>+1)</code>
  85. </p></dd>
  86. <dt> <em>P46</em></dt>
  87. <dd><p>([[<code>left</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(<var>n</var>+1)</code>
  88. </p></dd>
  89. <dt> <em>P47</em></dt>
  90. <dd><p>([[<code>right</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(<var>n</var>+1)</code>
  91. </p></dd>
  92. <dt> <em>P48</em></dt>
  93. <dd><p>(([[<code>fan</code>]] <code><var>f</var></code>)
  94. <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(<var>n</var>+1)</code>
  95. </p></dd>
  96. <dt> <em>P49</em></dt>
  97. <dd><p>([[<code>member</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid membership',nil)</code>]]<code>_(<var>n</var>+1)</code>
  98. </p></dd>
  99. <dt> <em>P50</em></dt>
  100. <dd><p>([[<code>distribute</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid distribution',nil)</code>]]<code>_(<var>n</var>+1)</code>
  101. </p></dd>
  102. <dt> <em>P51</em></dt>
  103. <dd><p>([[<code>cat</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid concatenation',nil)</code>]]<code>_(<var>n</var>+1)</code>
  104. </p></dd>
  105. <dt> <em>P52</em></dt>
  106. <dd><p>([[<code>meta</code>]] <code>nil</code>)<code>_<var>n</var></code> = [[<code>('invalid recursion',nil)</code>]]<code>_(<var>n</var>+1)</code>
  107. </p></dd>
  108. </dl>
  109. <p>Note that by virtue of property <em>P44</em>, there is no need for an
  110. application to make explicit checks for exceptional results at any
  111. point, because the exceptional result propagates through to the output
  112. of any function composed with the one that incurred it. For example, an
  113. application of the form <code>h = compose(f,right)</code>, which will cause an
  114. invalid deconstruction error if applied in filter mode to an empty file,
  115. imposes no requirement that <code>f</code> be written to accommodate that
  116. possibility (i.e., by checking for it) in order for the error to be
  117. reported properly. The following proof demonstrates that the meaning of <code>f</code>
  118. is irrelevant to the result.
  119. </p><table><tr><td>&nbsp;</td><td><pre class="format">[[<code>compose(f,right)</code>]]<code>_0</code> <code>nil_0</code>
  120. = [[<code>f</code>]]<code>_0</code> [[<code>right</code>]]<code>_0</code> <code>nil</code><code>_0</code>
  121. = [[<code>f</code>]]<code>_0</code> [[<code>('invalid deconstruction',nil)</code>]]<code>_1</code>
  122. = [[<code>('invalid deconstruction',nil)</code>]]<code>_1</code>
  123. </pre></td></tr></table>
  124. <p>In an application <code>h = compose(f,g)</code>, the input
  125. validation therefore may be confined to the &ldquo;front end&rdquo;, <code>g</code>.
  126. </p>
  127. <p>It will be recalled from the discussions of <code>recur</code> (<a href="Recur.html#Recur">Recur</a>)
  128. <a name="index-recur-1"></a>
  129. <a name="index-transpose-1"></a>
  130. and <code>transpose</code> (<a href="Transpose.html#Transpose">Transpose</a>) that the semantics of
  131. virtual code involving these forms is defined in terms of the
  132. <code>field</code> format for deconstruction functions (<a href="Field.html#Field">Field</a>),
  133. <a name="index-field-2"></a>
  134. which depends implicitly on the semantics of <code>left</code> and
  135. <code>right</code>, being a generalization of them. An invalid deconstruction
  136. <a name="index-left-2"></a>
  137. <a name="index-right-3"></a>
  138. message could therefore result from applications incorporating any of
  139. the forms of <code>recur</code>, <code>transpose</code>, or <code>field</code>. Invalid
  140. deconstructions could also arise from the <code>replace</code> operation
  141. <a name="index-replace-1"></a>
  142. <a name="index-assignment-1"></a>
  143. (<a href="Replace.html#Replace">Replace</a>), which is used for assignment (<a href="Assignment.html#Assignment">Assignment</a>), because
  144. <code>replace</code> is defined by virtual code, except as noted next.
  145. </p>
  146. <hr size="1">
  147. <table cellpadding="1" cellspacing="1" border="0">
  148. <tr><td valign="middle" align="left">[<a href="Operator-Generalization.html#Operator-Generalization" title="Previous section in reading order"> &lt; </a>]</td>
  149. <td valign="middle" align="left">[<a href="Expedient-Error-Messages.html#Expedient-Error-Messages" title="Next section in reading order"> &gt; </a>]</td>
  150. <td valign="middle" align="left"> &nbsp; </td>
  151. <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>
  152. <td valign="middle" align="left">[<a href="Exception-Handling.html#Exception-Handling" title="Up section"> Up </a>]</td>
  153. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  154. <td valign="middle" align="left"> &nbsp; </td>
  155. <td valign="middle" align="left"> &nbsp; </td>
  156. <td valign="middle" align="left"> &nbsp; </td>
  157. <td valign="middle" align="left"> &nbsp; </td>
  158. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  159. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  160. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  161. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  162. </tr></table>
  163. <p>
  164. <font size="-1">
  165. This document was generated on <i>December 10, 2012</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
  166. </font>
  167. <br>
  168. </p>
  169. </body>
  170. </html>