<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="generator" content="hevea 2.00"> <link rel="stylesheet" type="text/css" href="manual.css"> <title>The OCaml language</title> </head> <body> <a href="advexamples.html"><img src="previous_motif.gif" alt="Previous"></a> <a href="index.html"><img src="contents_motif.gif" alt="Up"></a> <a href="extn.html"><img src="next_motif.gif" alt="Next"></a> <hr> <h1 class="chapter" id="sec59">Chapter 6  The OCaml language</h1> <p> <a id="c:refman"></a> </p><h3 class="subsection" id="sec60">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="sec61">Notations</h3> <p>The syntax of the language is given in BNF-like notation. Terminal symbols are set in typewriter font (<span class="c005"><span class="c007">like</span> <span class="c007">this</span></span>). Non-terminal symbols are set in italic font (<span class="c014">like</span>  <span class="c014">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">Lexical conventions</a> </li><li><a href="values.html">Values</a> </li><li><a href="names.html">Names</a> </li><li><a href="types.html">Type expressions</a> </li><li><a href="const.html">Constants</a> </li><li><a href="patterns.html">Patterns</a> </li><li><a href="expr.html">Expressions</a> </li><li><a href="typedecl.html">Type and exception definitions</a> </li><li><a href="classes.html">Classes</a> </li><li><a href="modtypes.html">Module types (module specifications)</a> </li><li><a href="modules.html">Module expressions (module implementations)</a> </li><li><a href="compunit.html">Compilation units</a> </li></ul> <hr> <a href="advexamples.html"><img src="previous_motif.gif" alt="Previous"></a> <a href="index.html"><img src="contents_motif.gif" alt="Up"></a> <a href="extn.html"><img src="next_motif.gif" alt="Next"></a> </body> </html>