File: introExample59.tex

package info (click to toggle)
sollya 7.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 13,864 kB
  • sloc: ansic: 117,441; yacc: 8,822; lex: 2,419; makefile: 870; cpp: 76
file content (50 lines) | stat: -rw-r--r-- 1,604 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> structure.f = exp(x);
> structure.dom = [1;2];
> structure.formats = [| DD, D, D, D |];
> match structure with 
       { .f = sin(x);
         .dom = [a;b]
       }                    : { "Sine, ",a,", ",b; }
       { .f = exp(c);
         .dom = [a;b];
         .point = default 
       }                    : { "Exponential, ",a, ", ", b, ", ", c; }
       { .f = exp(x);
         .dom = [a;b]
       }                    : { "Exponential, ",a, ", ", b; }
       default              : { "Something else"; };
Exponential, 1, 2
> 
> structure.f = sin(x);
> match structure with 
       { .f = sin(x);
         .dom = [a;b]
       }                    : { "Sine, ",a,", ",b; }
       { .f = exp(c);
         .dom = [a;b];
         .point = default 
       }                    : { "Exponential, ",a, ", ", b, ", ", c; }
       { .f = exp(x);
         .dom = [a;b]
       }                    : { "Exponential, ",a, ", ", b; }
       default              : { "Something else"; };
Sine, 1, 2
> 
> structure.f = exp(x + 2);
> structure.point = 23;
> match structure with 
       { .f = sin(x);
         .dom = [a;b]
       }                    : { "Sine, ",a,", ",b; }
       { .f = exp(c);
         .dom = [a;b];
         .point = default 
       }                    : { "Exponential, ",a, ", ", b, ", ", c; }
       { .f = exp(x);
         .dom = [a;b]
       }                    : { "Exponential, ",a, ", ", b; }
       default              : { "Something else"; };
Exponential, 1, 2, 2 + x
\end{Verbatim}
\end{minipage}\end{center}