[SDL Forum Society - Logo] Tutorial on SDL-88
Belina, Hogrefe (edits Reed)

6.3 Error terms

Back Home Up Next

Sometimes an operator should only operate on a subset of the elements of a sort. For the other elements, the result of the operator should be undefined, or the application of the operator should not be allowed to these elements. In SDL-88 the user has the possibility to specify a forbidden application of an operator. For this purpose the special term Error! is implicitly included in any sort.

A classical example here is again the division operator. The application of the operator to zero should not be allowed:

FOR ALL x, z IN Real
(x/0) == Error!);

Error! means: “Application of the operator to this element is not allowed, and if done, the future behaviour of the system is undefined".

Back Home Up Next

Contact the webmaster with questions or comments about this web site.
Copyright © 1997-May, 2013 SDL Forum Society