File: introExample51.tex

package info (click to toggle)
sollya 8.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,592 kB
  • sloc: ansic: 124,655; yacc: 7,543; lex: 2,440; makefile: 888; cpp: 77
file content (60 lines) | stat: -rw-r--r-- 1,624 bytes parent folder | download | duplicates (2)
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
Fri Feb 18 13:12:15 AKST 2022
true
\end{Verbatim}
\end{minipage}\end{center}