summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/checklistings/example.html
blob: 5a78714da5a76dedf40b3d1228ddec796d28ceef (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="generator" content="hevea 2.16">
<style type="text/css">
.li-itemize{margin:1ex 0ex;}
.li-enumerate{margin:1ex 0ex;}
.dd-description{margin:0ex 0ex 1ex 4ex;}
.dt-description{margin:0ex;}
.toc{list-style:none;}
.footnotetext{margin:0ex; padding:0ex;}
div.footnotetext P{margin:0px; text-indent:1em;}
.thefootnotes{text-align:left;margin:0ex;}
.dt-thefootnotes{margin:0em;}
.dd-thefootnotes{margin:0em 0em 0em 2em;}
.footnoterule{margin:1em auto 1em 0px;width:50%;}
.caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto}
.title{margin:2ex auto;text-align:center}
.titlemain{margin:1ex 2ex 2ex 1ex;}
.titlerest{margin:0ex 2ex;}
.center{text-align:center;margin-left:auto;margin-right:auto;}
.flushleft{text-align:left;margin-left:0ex;margin-right:auto;}
.flushright{text-align:right;margin-left:auto;margin-right:0ex;}
div table{margin-left:inherit;margin-right:inherit;margin-bottom:2px;margin-top:2px}
td table{margin:auto;}
table{border-collapse:collapse;}
td{padding:0;}
.cellpadding0 tr td{padding:0;}
.cellpadding1 tr td{padding:1px;}
pre{text-align:left;margin-left:0ex;margin-right:auto;}
blockquote{margin-left:4ex;margin-right:4ex;text-align:left;}
td p{margin:0px;}
.boxed{border:1px solid black}
.textboxed{border:1px solid black}
.vbar{border:none;width:2px;background-color:black;}
.hbar{border:none;height:2px;width:100%;background-color:black;}
.hfill{border:none;height:1px;width:200%;background-color:black;}
.vdisplay{border-collapse:separate;border-spacing:2px;width:auto; empty-cells:show; border:2px solid red;}
.vdcell{white-space:nowrap;padding:0px; border:2px solid green;}
.display{border-collapse:separate;border-spacing:2px;width:auto; border:none;}
.dcell{white-space:nowrap;padding:0px; border:none;}
.dcenter{margin:0ex auto;}
.vdcenter{border:solid #FF8000 2px; margin:0ex auto;}
.minipage{text-align:left; margin-left:0em; margin-right:auto;}
.marginpar{border:solid thin black; width:20%; text-align:left;}
.marginparleft{float:left; margin-left:0ex; margin-right:1ex;}
.marginparright{float:right; margin-left:1ex; margin-right:0ex;}
.theorem{text-align:left;margin:1ex auto 1ex 0ex;}
.part{margin:2ex auto;text-align:center}
.lstlisting{font-family:monospace;white-space:pre;margin-right:auto;margin-left:0pt;text-align:left}
.chklistingerr{font-style: italic; color: red;}
.chklistingmsg{font-style: italic;}
</style>
<title>example</title>
</head>
<body >
<!--HEVEA command line is: /usr/bin/hevea -fix example -->
<!--CUT STYLE article--><!--CUT DEF section 1 --><p>Two simple declarations:
</p><div class="lstlisting chklisting"><span style="font-family:sans-serif"><span style="font-weight:bold">let</span></span><span style="font-family:sans-serif"> </span><span style="font-family:sans-serif">x</span><span style="font-family:sans-serif"> = 3</span><span style="font-family:sans-serif">
</span><span style="font-family:sans-serif"><span style="font-weight:bold">let</span></span><span style="font-family:sans-serif"> </span><span style="font-family:sans-serif">f</span><span style="font-family:sans-serif"> </span><span style="font-family:sans-serif">x</span><span style="font-family:sans-serif"> = </span><span style="font-family:sans-serif">x</span><span style="font-family:sans-serif"> + 1</span></div><p>and, after compilation with <em>ocamlc -i example.ml</em>, their types:
</p><div class="lstlisting chklistingmsg">val x : int
val f : int -&gt; int</div><p>Then, building on these definitions:
</p><div class="lstlisting chklisting"><span style="font-family:sans-serif"><span style="font-weight:bold">let</span></span><span style="font-family:sans-serif"> </span><span style="font-family:sans-serif">y</span><span style="font-family:sans-serif"> = </span><span style="font-family:sans-serif">f</span><span style="font-family:sans-serif"> 3</span></div><div class="lstlisting chklistingmsg">val y : int</div><p>What about compiler error messages?:
</p><div class="lstlisting chklisting"><span style="font-family:sans-serif"><span style="font-weight:bold">let</span></span><span style="font-family:sans-serif"> </span><span style="font-family:sans-serif">z</span><span style="font-family:sans-serif"> = 3 + </span><span style="font-family:sans-serif"><span style="font-family:sans-serif">"four"</span></span></div><p>They are also detected:
</p><div class="lstlisting chklistingerr">File "example.ml", line 1, characters 12-18:
Error: This expression has type string but an expression was expected of type
         int</div><p>We can continue on from earlier examples:</p><div class="lstlisting chklisting"><span style="font-family:sans-serif"><span style="font-weight:bold">let</span></span><span style="font-family:sans-serif"> </span><span style="font-family:sans-serif">z</span><span style="font-family:sans-serif"> = </span><span style="font-family:sans-serif">f</span><span style="font-family:sans-serif"> </span><span style="font-family:sans-serif">y</span></div><div class="lstlisting chklistingmsg">val z : int</div><!--CUT END -->
<!--HTMLFOOT-->
<!--ENDHTML-->
<!--FOOTER-->
<hr style="height:2"><blockquote class="quote"><em>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
</em><a href="http://hevea.inria.fr/index.html"><em>H</em><em><span style="font-size:small"><sup>E</sup></span></em><em>V</em><em><span style="font-size:small"><sup>E</sup></span></em><em>A</em></a><em>.</em></blockquote></body>
</html>