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

2.7.15.3 Error Messages

The basic strategy for representing the results of exceptional conditions arising from the evaluation of operands on a given level of the hierarchy will be to use an error message corresponding to the image of a list of character strings on the level above.

Unfortunately, the official silly standard does not define character constants, but they are available as a vendor specific extension in silly-me (millennium edition), where character strings may be enclosed in single quotes. The value of the semantic function [[…]] in the case of a character string is the list of representations of the characters, based on Character Table and Representation of Numeric and Textual Data.

For the sake of consistency, each standard error message is a list of character strings, even though the list has only one string in it. If any exceptional condition is the result of a computation, it is written to standard error by avram as the list of character strings it represents.

P45

([[compare]] nil)_n = [[('invalid comparison',nil)]]_(n+1)

P46

([[left]] nil)_n = [[('invalid deconstruction',nil)]]_(n+1)

P47

([[right]] nil)_n = [[('invalid deconstruction',nil)]]_(n+1)

P48

(([[fan]] f) nil)_n = [[('invalid deconstruction',nil)]]_(n+1)

P49

([[member]] nil)_n = [[('invalid membership',nil)]]_(n+1)

P50

([[distribute]] nil)_n = [[('invalid distribution',nil)]]_(n+1)

P51

([[cat]] nil)_n = [[('invalid concatenation',nil)]]_(n+1)

P52

([[meta]] nil)_n = [[('invalid recursion',nil)]]_(n+1)

Note that by virtue of property P44, there is no need for an application to make explicit checks for exceptional results at any point, because the exceptional result propagates through to the output of any function composed with the one that incurred it. For example, an application of the form h = compose(f,right), which will cause an invalid deconstruction error if applied in filter mode to an empty file, imposes no requirement that f be written to accommodate that possibility (i.e., by checking for it) in order for the error to be reported properly. The following proof demonstrates that the meaning of f is irrelevant to the result.

 
[[compose(f,right)]]_0 nil_0

   = [[f]]_0 [[right]]_0 nil_0

   = [[f]]_0 [[('invalid deconstruction',nil)]]_1

   = [[('invalid deconstruction',nil)]]_1

In an application h = compose(f,g), the input validation therefore may be confined to the “front end”, g.

It will be recalled from the discussions of recur (Recur) and transpose (Transpose) that the semantics of virtual code involving these forms is defined in terms of the field format for deconstruction functions (Field), which depends implicitly on the semantics of left and right, being a generalization of them. An invalid deconstruction message could therefore result from applications incorporating any of the forms of recur, transpose, or field. Invalid deconstructions could also arise from the replace operation (Replace), which is used for assignment (Assignment), because replace is defined by virtual code, except as noted next.


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

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