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
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="hevea 2.32">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="manual.css">
<title>Chapter 7 The OCaml language</title>
</head>
<body>
<a href="advexamples.html"><img src="previous_motif.svg" alt="Previous"></a>
<a href="index.html"><img src="contents_motif.svg" alt="Up"></a>
<a href="extn.html"><img src="next_motif.svg" alt="Next"></a>
<hr>
<h1 class="chapter" id="sec73">Chapter 7 The OCaml language</h1>
<p> <a id="c:refman"></a>
</p><h3 class="subsection" id="ss:foreword"><a class="section-anchor" href="#ss:foreword" aria-hidden="true"></a>Foreword</h3>
<p>This document is intended as a reference manual for the OCaml
language. It lists the language constructs, and gives their precise
syntax and informal semantics. It is by no means a tutorial
introduction to the language: there is not a single example. A good
working knowledge of OCaml is assumed.</p><p>No attempt has been made at mathematical rigor: words are employed
with their intuitive meaning, without further definition. As a
consequence, the typing rules have been left out, by lack of the
mathematical framework required to express them, while they are
definitely part of a full formal definition of the language.</p><h3 class="subsection" id="ss:notations"><a class="section-anchor" href="#ss:notations" aria-hidden="true"></a>Notations</h3>
<p>The syntax of the language is given in BNF-like notation. Terminal
symbols are set in typewriter font (<span class="c002"><span class="c003">like</span> <span class="c003">this</span></span>).
Non-terminal symbols are set in italic font (<span class="c010">like</span> <span class="c010">that</span>).
Square brackets […] denote optional components. Curly brackets
{…} denotes zero, one or several repetitions of the enclosed
components. Curly brackets with a trailing plus sign {…}<sup>+</sup>
denote one or several repetitions of the enclosed components.
Parentheses (…) denote grouping.</p><ul>
<li><a href="lex.html">7.1 Lexical conventions</a>
</li><li><a href="values.html">7.2 Values</a>
</li><li><a href="names.html">7.3 Names</a>
</li><li><a href="types.html">7.4 Type expressions</a>
</li><li><a href="const.html">7.5 Constants</a>
</li><li><a href="patterns.html">7.6 Patterns</a>
</li><li><a href="expr.html">7.7 Expressions</a>
</li><li><a href="typedecl.html">7.8 Type and exception definitions</a>
</li><li><a href="classes.html">7.9 Classes</a>
</li><li><a href="modtypes.html">7.10 Module types (module specifications)</a>
</li><li><a href="modules.html">7.11 Module expressions (module implementations)</a>
</li><li><a href="compunit.html">7.12 Compilation units</a>
</li></ul>
<hr>
<a href="advexamples.html"><img src="previous_motif.svg" alt="Previous"></a>
<a href="index.html"><img src="contents_motif.svg" alt="Up"></a>
<a href="extn.html"><img src="next_motif.svg" alt="Next"></a>
</body>
</html>
|