Error-Messages.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <html lang="en">
  2. <head>
  3. <title>Error Messages - 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="Exception-Handling.html#Exception-Handling" title="Exception Handling">
  9. <link rel="prev" href="Operator-Generalization.html#Operator-Generalization" title="Operator Generalization">
  10. <link rel="next" href="Expedient-Error-Messages.html#Expedient-Error-Messages" title="Expedient Error Messages">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="Error-Messages"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Expedient-Error-Messages.html#Expedient-Error-Messages">Expedient Error Messages</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="Operator-Generalization.html#Operator-Generalization">Operator Generalization</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="Exception-Handling.html#Exception-Handling">Exception Handling</a>
  32. <hr>
  33. </div>
  34. <h5 class="subsubsection">2.7.15.3 Error Messages</h5>
  35. <p>The basic strategy for representing the results of exceptional
  36. conditions arising from the evaluation of operands on a given level of
  37. the hierarchy will be to use an error message corresponding to the image
  38. of a list of character strings on the level above.
  39. <p>Unfortunately, the official <code>silly</code> standard does not
  40. define character constants, but they are available as a vendor specific
  41. extension in <code>silly-me</code> (millennium edition), where character strings
  42. <a name="index-g_t_0040code_007bsilly_002dme_007d-356"></a><a name="index-strings-357"></a><a name="index-character-strings-358"></a>may be enclosed in single quotes. The value of the semantic
  43. <a name="index-semantic-function-359"></a>function [[<small class="dots">...</small>]] in the case of a character string is the list
  44. of representations of the characters, based on <a href="Character-Table.html#Character-Table">Character Table</a>
  45. and <a href="Representation-of-Numeric-and-Textual-Data.html#Representation-of-Numeric-and-Textual-Data">Representation of Numeric and Textual Data</a>.
  46. <p>For the sake of consistency, each standard error message is a list of
  47. character strings, even though the list has only one string in it. If
  48. any exceptional condition is the result of a computation, it is written
  49. to standard error by <code>avram</code> as the list of character strings it
  50. represents.
  51. <dl>
  52. <dt><em>P45</em><dd>([[<code>compare</code>]] <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid comparison',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  53. <br><dt><em>P46</em><dd>([[<code>left</code>]] <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  54. <br><dt><em>P47</em><dd>([[<code>right</code>]] <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  55. <br><dt><em>P48</em><dd>(([[<code>fan</code>]] <var>f</var>)
  56. <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid deconstruction',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  57. <br><dt><em>P49</em><dd>([[<code>member</code>]] <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid membership',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  58. <br><dt><em>P50</em><dd>([[<code>distribute</code>]] <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid distribution',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  59. <br><dt><em>P51</em><dd>([[<code>cat</code>]] <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid concatenation',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  60. <br><dt><em>P52</em><dd>([[<code>meta</code>]] <code>nil</code>)<code>_</code><var>n</var> = [[<code>('invalid recursion',nil)</code>]]<code>_(</code><var>n</var><code>+1)</code>
  61. </dl>
  62. <p>Note that by virtue of property <em>P44</em>, there is no need for an
  63. application to make explicit checks for exceptional results at any
  64. point, because the exceptional result propagates through to the output
  65. of any function composed with the one that incurred it. For example, an
  66. application of the form <code>h = compose(f,right)</code>, which will cause an
  67. invalid deconstruction error if applied in filter mode to an empty file,
  68. imposes no requirement that <code>f</code> be written to accommodate that
  69. possibility (i.e., by checking for it) in order for the error to be
  70. reported properly. The following proof demonstrates that the meaning of <code>f</code>
  71. is irrelevant to the result.
  72. <pre class="format">[[<code>compose(f,right)</code>]]<code>_0</code> <code>nil_0</code>
  73. = [[<code>f</code>]]<code>_0</code> [[<code>right</code>]]<code>_0</code> <code>nil</code><code>_0</code>
  74. = [[<code>f</code>]]<code>_0</code> [[<code>('invalid deconstruction',nil)</code>]]<code>_1</code>
  75. = [[<code>('invalid deconstruction',nil)</code>]]<code>_1</code>
  76. </pre>
  77. <p class="noindent">In an application <code>h = compose(f,g)</code>, the input
  78. validation therefore may be confined to the &ldquo;front end&rdquo;,&nbsp;<code>g</code>.<!-- /@w -->
  79. <p>It will be recalled from the discussions of <code>recur</code> (<a href="Recur.html#Recur">Recur</a>)
  80. <a name="index-g_t_0040code_007brecur_007d-360"></a><a name="index-g_t_0040code_007btranspose_007d-361"></a>and <code>transpose</code> (<a href="Transpose.html#Transpose">Transpose</a>) that the semantics of
  81. virtual code involving these forms is defined in terms of the
  82. <code>field</code> format for deconstruction functions (<a href="Field.html#Field">Field</a>),
  83. <a name="index-g_t_0040code_007bfield_007d-362"></a>which depends implicitly on the semantics of <code>left</code> and
  84. <code>right</code>, being a generalization of them. An invalid deconstruction
  85. <a name="index-g_t_0040code_007bleft_007d-363"></a><a name="index-g_t_0040code_007bright_007d-364"></a>message could therefore result from applications incorporating any of
  86. the forms of <code>recur</code>, <code>transpose</code>, or <code>field</code>. Invalid
  87. deconstructions could also arise from the <code>replace</code> operation
  88. <a name="index-g_t_0040code_007breplace_007d-365"></a><a name="index-assignment-366"></a>(<a href="Replace.html#Replace">Replace</a>), which is used for assignment (<a href="Assignment.html#Assignment">Assignment</a>), because
  89. <code>replace</code> is defined by virtual code, except as noted next.
  90. </body></html>