File: introExample51.tex

package info (click to toggle)
sollya 6.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 13,376 kB
  • ctags: 5,132
  • sloc: ansic: 120,010; yacc: 8,738; lex: 2,494; makefile: 854; cpp: 76
file content (60 lines) | stat: -rw-r--r-- 1,624 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> match exp(sin(x)) with
      exp(a)  : { 
                   write("Exponential of ", a, "\n");
                   return a;
                }
      sin(x)  : {
                   var foo;
                   foo = 17;
                   write("Sine of x\n");
                   return foo;
                }
      default : {
                   write("Something else\n");
                   bashexecute("LANG=C date");
                   return true;
                };
Exponential of sin(x)
sin(x)
> 
> match sin(x) with
      exp(a)  : { 
                   write("Exponential of ", a, "\n");
                   return a;
                }
      sin(x)  : {
                   var foo;
                   foo = 17;
                   write("Sine of x\n");
                   return foo;
                }
      default : {
                   write("Something else\n");
                   bashexecute("LANG=C date");
                   return true;
                };
Sine of x
17
> 
> match acos(17 * pi * x) with
      exp(a)  : { 
                   write("Exponential of ", a, "\n");
                   return a;
                }
      sin(x)  : {
                   var foo;
                   foo = 17;
                   write("Sine of x\n");
                   return foo;
                }
      default : {
                   write("Something else\n");
                   bashexecute("LANG=C date");
                   return true;
                };
Something else
Mon Oct 17 09:47:15 CEST 2016
true
\end{Verbatim}
\end{minipage}\end{center}