Unfinished work on figures Data Types and Condition Types.
[clqr.git] / clqr-conditions-and-errors.mp
blob445a353c455f781bb7f6e14ec46397b0d0b3fcf2
1 % Copyright (C) 2010 Bert Burgemeister
3 % Permission is granted to copy, distribute and/or modify this
4 % document under the terms of the GNU Free Documentation License,
5 % Version 1.2 or any later version published by the Free Software
6 % Foundation; with no Invariant Sections, no Front-Cover Texts and
7 % no Back-Cover Texts. For details see file COPYING.
9 prologues := 3;
10 input boxes
11 verbatimtex
12 \documentclass[8pt,pagesize,twoside,footexclude,headexclude]{scrartcl}
13 \input{clqr.packages}
14 \input{clqr.macros}
15 \begin{document}
16 etex
18 beginfig(1);
19   
20   boxit.t(btex \T etex);
21   t.nw = (0, 0);
22   drawboxed(t);
23   
24   boxit.condition(btex \kwd*{CONDITION} etex);
25   t.w = condition.e;
26   drawboxed(condition);
28   boxjoin(a.sw + (0, -3) = b.nw);
29   boxit.warning(btex \kwd*{WARNING} etex);
30   boxit.simple_condition(btex \kwd*{SIMPLE-CONDITION} etex);
31   boxit.serious_condition(btex \kwd*{SERIOUS-CONDITION} etex);
32   condition.se = warning.ne;
33   drawboxed(warning, simple_condition, serious_condition);
35   boxjoin(a.sw + (0, -3) = b.nw);
36   boxit.style_warning(btex \kwd*{STYLE-WARNING} etex);
37   serious_condition.sw = style_warning.nw;
38   drawboxed(style_warning);
40   boxjoin(a.sw + (0, -3) = b.nw);
41   boxit.simple_warning(btex \kwd*{SIMPLE-WARNING} etex);
42   style_warning.sw = simple_warning.nw;
43   drawboxed(simple_warning);
45   boxjoin(a.sw + (0, -3) = b.nw);
46   boxit.storage_condition(btex \kwd*{STORAGE-CONDITION} etex);
47   boxit.error(btex \kwd*{ERROR}\\ etex);
48   simple_warning.sw = storage_condition.nw;
49   drawboxed(storage_condition);
51   boxjoin(a.sw + (0, -3) = b.nw);
52   boxit.simple_error(btex \kwd*{SIMPLE-ERROR} etex);
53   error.sw = simple_error.nw;
54   drawboxed(simple_error);
56   boxjoin(a.sw + (0, -3) = b.nw);
57   boxit.parse_error(btex \kwd*{PARSE-ERROR} etex);
58   boxit.program_error(btex \kwd*{PROGRAM-ERROR} etex);
59   boxit.control_error(btex \kwd*{CONTROL-ERROR} etex);
60   boxit.type_error(btex \kwd*{TYPE-ERROR} etex);
61   boxit.cell_error(btex \kwd*{CELL-ERROR} etex);
62   boxit.stream_error(btex \kwd*{STREAM-ERROR} etex);
63   boxit.package_error(btex \kwd*{PACKAGE-ERROR} etex);
64   boxit.file_error(btex \kwd*{FILE-ERROR} etex);
65   boxit.print_not_readable(btex \kwd*{PRINT-NOT-READABLE} etex);
66   boxit.arithmetic_error(btex \kwd*{ARITHMETIC-ERROR} etex);
67   simple_error.sw = parse_error.nw;
68   drawboxed(parse_error, program_error, control_error, type_error, cell_error, stream_error, package_error, file_error, print_not_readable, arithmetic_error);
70   boxjoin(a.sw + (0, -3) = b.nw);
71   boxit.simple_type_error(btex \kwd*{SIMPLE-TYPE-ERROR} etex);
72   arithmetic_error.sw = simple_type_error.nw;
73   drawboxed(simple_type_error);
75   boxjoin(a.sw + (0, -3) = b.nw);
76   boxit.unbound_variable(btex  \kwd*{UNBOUND-VARIABLE} etex);
77   boxit.unbound_slot(btex  \kwd*{UNBOUND-SLOT} etex);
78   boxit.undefined_function(btex  \kwd*{UNDEFINED-FUNCTION} etex);
79   simple_type_error.sw = unbound_variable.nw;
80   drawboxed(unbound_variable, unbound_slot, undefined_function);                
81   
82   boxjoin(a.sw + (0, -3) = b.nw);
83   boxit.end_of_file(btex  \kwd*{END-OF-FILE} etex);
84   undefined_function.sw = end_of_file.nw;
85   drawboxed(end_of_file);
86   
87   boxjoin(a.sw + (0, -3) = b.nw);
88   boxit.reader_error(btex \kwd*{READER-ERROR} etex);
89   end_of_file.sw = reader_error.nw;
90   drawboxed(reader_error);
92   boxjoin(a.sw + (0, -3) = b.nw);
93   boxit.division_by_zero(btex  \kwd*{DIVISION-BY-ZERO} etex);
94   boxit.floating_point_inexact(btex  \kwd*{FLOATING-POINT-INEXACT} etex);
95   boxit.floating_point_invalid_operation(btex  \kwd*{FLOATING-POINT-INVALID-OPERATION} etex);
96   boxit.floating_point_overflow(btex  \kwd*{FLOATING-POINT-OVERFLOW} etex);
97   boxit.floating_point_underflow(btex  \kwd*{FLOATING-POINT-UNDERFLOW} etex);
98   reader_error.sw = floating_point_inexact.nw;
99   drawboxed(floating_point_inexact, floating_point_invalid_operation, floating_point_overflow, floating_point_underflow);
101   drawarrow t.e{right} .. {right}t.e+(40,0) .. warning.n{down};
102   
103 endfig;
105 verbatimtex
106 \end{document}
107 etex