File: introExample55.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 (29 lines) | stat: -rw-r--r-- 1,029 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
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> match exp(x) with 
      sin(x)    : ("Sine of x")
      atan(x^2) : ("Arctangent of square of x")
      default   : ("Something else")
      exp(x)    : ("Exponential of x");
Something else
> 
> match atan(x^2) with 
      sin(x)          : ("Sine of x")
      atan(default^2) : ("Arctangent of the square of something")
      default         : ("Something else");
Arctangent of the square of something
> 
> match atan(exp(x)^2) with 
      sin(x)          : ("Sine of x")
      atan(default^2) : ("Arctangent of the square of something")
      default         : ("Something else");
Arctangent of the square of something
> 
> match exp("Hello world") with 
      exp(default)    : ("A miracle has happened")
      default         : ("Something else");
Warning: at least one of the given expressions or a subexpression is not correct
ly typed
or its evaluation has failed because of some error on a side-effect.
error
\end{Verbatim}
\end{minipage}\end{center}