<!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>Contents</title> </head> <body> <a href="index.html"><img src="contents_motif.gif" alt="Up"></a> <a href="foreword.html"><img src="next_motif.gif" alt="Next"></a> <hr> <h1 class="chapter" id="sec1">Contents</h1> <ul class="ftoc1"><li class="li-toc"> <a href="index.html#sec6">Part I  An introduction to OCaml</a> <ul class="ftoc2"><li class="li-toc"> <a href="coreexamples.html#sec7">Chapter 1  The core language</a> <ul class="ftoc3"><li class="li-toc"> <a href="coreexamples.html#sec8">1.1  Basics</a> </li><li class="li-toc"><a href="coreexamples.html#sec9">1.2  Data types</a> </li><li class="li-toc"><a href="coreexamples.html#sec10">1.3  Functions as values</a> </li><li class="li-toc"><a href="coreexamples.html#sec11">1.4  Records and variants</a> </li><li class="li-toc"><a href="coreexamples.html#sec12">1.5  Imperative features</a> </li><li class="li-toc"><a href="coreexamples.html#sec13">1.6  Exceptions</a> </li><li class="li-toc"><a href="coreexamples.html#sec14">1.7  Symbolic processing of expressions</a> </li><li class="li-toc"><a href="coreexamples.html#sec15">1.8  Pretty-printing and parsing</a> </li><li class="li-toc"><a href="coreexamples.html#sec16">1.9  Standalone OCaml programs</a> </li></ul> </li><li class="li-toc"><a href="moduleexamples.html#sec17">Chapter 2  The module system</a> <ul class="ftoc3"><li class="li-toc"> <a href="moduleexamples.html#sec18">2.1  Structures</a> </li><li class="li-toc"><a href="moduleexamples.html#sec19">2.2  Signatures</a> </li><li class="li-toc"><a href="moduleexamples.html#sec20">2.3  Functors</a> </li><li class="li-toc"><a href="moduleexamples.html#sec21">2.4  Functors and type abstraction</a> </li><li class="li-toc"><a href="moduleexamples.html#sec22">2.5  Modules and separate compilation</a> </li></ul> </li><li class="li-toc"><a href="objectexamples.html#sec23">Chapter 3  Objects in OCaml</a> <ul class="ftoc3"><li class="li-toc"> <a href="objectexamples.html#sec24">3.1  Classes and objects</a> </li><li class="li-toc"><a href="objectexamples.html#sec25">3.2  Immediate objects</a> </li><li class="li-toc"><a href="objectexamples.html#sec26">3.3  Reference to self</a> </li><li class="li-toc"><a href="objectexamples.html#sec27">3.4  Initializers</a> </li><li class="li-toc"><a href="objectexamples.html#sec28">3.5  Virtual methods</a> </li><li class="li-toc"><a href="objectexamples.html#sec29">3.6  Private methods</a> </li><li class="li-toc"><a href="objectexamples.html#sec30">3.7  Class interfaces</a> </li><li class="li-toc"><a href="objectexamples.html#sec31">3.8  Inheritance</a> </li><li class="li-toc"><a href="objectexamples.html#sec32">3.9  Multiple inheritance</a> </li><li class="li-toc"><a href="objectexamples.html#sec33">3.10  Parameterized classes</a> </li><li class="li-toc"><a href="objectexamples.html#sec34">3.11  Polymorphic methods</a> </li><li class="li-toc"><a href="objectexamples.html#sec35">3.12  Using coercions</a> </li><li class="li-toc"><a href="objectexamples.html#sec36">3.13  Functional objects</a> </li><li class="li-toc"><a href="objectexamples.html#sec37">3.14  Cloning objects</a> </li><li class="li-toc"><a href="objectexamples.html#sec38">3.15  Recursive classes</a> </li><li class="li-toc"><a href="objectexamples.html#sec39">3.16  Binary methods</a> </li><li class="li-toc"><a href="objectexamples.html#sec40">3.17  Friends</a> </li></ul> </li><li class="li-toc"><a href="lablexamples.html#sec41">Chapter 4  Labels and variants</a> <ul class="ftoc3"><li class="li-toc"> <a href="lablexamples.html#sec42">4.1  Labels</a> <ul class="ftoc4"><li class="li-toc"> <a href="lablexamples.html#sec43">4.1.1  Optional arguments</a> </li><li class="li-toc"><a href="lablexamples.html#sec44">4.1.2  Labels and type inference</a> </li><li class="li-toc"><a href="lablexamples.html#sec45">4.1.3  Suggestions for labeling</a> </li></ul> </li><li class="li-toc"><a href="lablexamples.html#sec46">4.2  Polymorphic variants</a> <ul class="ftoc4"><li class="li-toc"> <a href="lablexamples.html#sec49">4.2.1  Weaknesses of polymorphic variants</a> </li></ul> </li></ul> </li><li class="li-toc"><a href="advexamples.html#sec50">Chapter 5  Advanced examples with classes and modules</a> <ul class="ftoc3"><li class="li-toc"> <a href="advexamples.html#sec51">5.1  Extended example: bank accounts</a> </li><li class="li-toc"><a href="advexamples.html#sec52">5.2  Simple modules as classes</a> <ul class="ftoc4"><li class="li-toc"> <a href="advexamples.html#sec53">5.2.1  Strings</a> </li><li class="li-toc"><a href="advexamples.html#sec55">5.2.2  Hashtbl</a> </li><li class="li-toc"><a href="advexamples.html#sec56">5.2.3  Sets</a> </li></ul> </li><li class="li-toc"><a href="advexamples.html#sec57">5.3  The subject/observer pattern</a> </li></ul> </li></ul> </li><li class="li-toc"><a href="index.html#sec58">Part II  The OCaml language</a> <ul class="ftoc2"><li class="li-toc"> <a href="language.html#sec59">Chapter 6  The OCaml language</a> <ul class="ftoc3"><li class="li-toc"> <a href="lex.html#sec62">6.1  Lexical conventions</a> </li><li class="li-toc"><a href="values.html#sec75">6.2  Values</a> <ul class="ftoc4"><li class="li-toc"> <a href="values.html#sec76">6.2.1  Base values</a> </li><li class="li-toc"><a href="values.html#sec81">6.2.2  Tuples</a> </li><li class="li-toc"><a href="values.html#sec82">6.2.3  Records</a> </li><li class="li-toc"><a href="values.html#sec83">6.2.4  Arrays</a> </li><li class="li-toc"><a href="values.html#sec84">6.2.5  Variant values</a> </li><li class="li-toc"><a href="values.html#sec85">6.2.6  Polymorphic variants</a> </li><li class="li-toc"><a href="values.html#sec86">6.2.7  Functions</a> </li><li class="li-toc"><a href="values.html#sec87">6.2.8  Objects</a> </li></ul> </li><li class="li-toc"><a href="names.html#sec88">6.3  Names</a> </li><li class="li-toc"><a href="types.html#sec91">6.4  Type expressions</a> </li><li class="li-toc"><a href="const.html#sec102">6.5  Constants</a> </li><li class="li-toc"><a href="patterns.html#sec103">6.6  Patterns</a> </li><li class="li-toc"><a href="expr.html#sec115">6.7  Expressions</a> <ul class="ftoc4"><li class="li-toc"> <a href="expr.html#sec116">6.7.1  Basic expressions</a> </li><li class="li-toc"><a href="expr.html#sec124">6.7.2  Control structures</a> </li><li class="li-toc"><a href="expr.html#sec131">6.7.3  Operations on data structures</a> </li><li class="li-toc"><a href="expr.html#sec138">6.7.4  Operators</a> </li><li class="li-toc"><a href="expr.html#sec139">6.7.5  Objects</a> </li><li class="li-toc"><a href="expr.html#sec145">6.7.6  Coercions</a> </li></ul> </li><li class="li-toc"><a href="typedecl.html#sec149">6.8  Type and exception definitions</a> <ul class="ftoc4"><li class="li-toc"> <a href="typedecl.html#sec150">6.8.1  Type definitions</a> </li><li class="li-toc"><a href="typedecl.html#sec151">6.8.2  Exception definitions</a> </li></ul> </li><li class="li-toc"><a href="classes.html#sec152">6.9  Classes</a> <ul class="ftoc4"><li class="li-toc"> <a href="classes.html#sec153">6.9.1  Class types</a> </li><li class="li-toc"><a href="classes.html#sec162">6.9.2  Class expressions</a> </li><li class="li-toc"><a href="classes.html#sec175">6.9.3  Class definitions</a> </li><li class="li-toc"><a href="classes.html#sec178">6.9.4  Class specifications</a> </li><li class="li-toc"><a href="classes.html#sec179">6.9.5  Class type definitions</a> </li></ul> </li><li class="li-toc"><a href="modtypes.html#sec180">6.10  Module types (module specifications)</a> <ul class="ftoc4"><li class="li-toc"> <a href="modtypes.html#sec181">6.10.1  Simple module types</a> </li><li class="li-toc"><a href="modtypes.html#sec182">6.10.2  Signatures</a> </li><li class="li-toc"><a href="modtypes.html#sec192">6.10.3  Functor types</a> </li><li class="li-toc"><a href="modtypes.html#sec193">6.10.4  The <span class="c007">with</span> operator</a> </li></ul> </li><li class="li-toc"><a href="modules.html#sec194">6.11  Module expressions (module implementations)</a> <ul class="ftoc4"><li class="li-toc"> <a href="modules.html#sec195">6.11.1  Simple module expressions</a> </li><li class="li-toc"><a href="modules.html#sec196">6.11.2  Structures</a> </li><li class="li-toc"><a href="modules.html#sec206">6.11.3  Functors</a> </li></ul> </li><li class="li-toc"><a href="compunit.html#sec209">6.12  Compilation units</a> </li></ul> </li><li class="li-toc"><a href="extn.html#sec210">Chapter 7  Language extensions</a> <ul class="ftoc3"><li class="li-toc"> <a href="extn.html#sec211">7.1  Integer literals for types <span class="c007">int32</span>, <span class="c007">int64</span> and <span class="c007">nativeint</span></a> </li><li class="li-toc"><a href="extn.html#sec212">7.2  Streams and stream parsers</a> </li><li class="li-toc"><a href="extn.html#sec213">7.3  Recursive definitions of values</a> </li><li class="li-toc"><a href="extn.html#sec214">7.4  Range patterns</a> </li><li class="li-toc"><a href="extn.html#sec215">7.5  Assertion checking</a> </li><li class="li-toc"><a href="extn.html#sec216">7.6  Lazy evaluation</a> <ul class="ftoc4"><li class="li-toc"> <a href="extn.html#sec217">7.6.1  Lazy expressions</a> </li><li class="li-toc"><a href="extn.html#sec218">7.6.2  Lazy patterns</a> </li></ul> </li><li class="li-toc"><a href="extn.html#sec219">7.7  Local modules</a> </li><li class="li-toc"><a href="extn.html#sec220">7.8  Recursive modules</a> </li><li class="li-toc"><a href="extn.html#sec221">7.9  Private types</a> <ul class="ftoc4"><li class="li-toc"> <a href="extn.html#sec222">7.9.1  Private variant and record types</a> </li><li class="li-toc"><a href="extn.html#sec223">7.9.2  Private type abbreviations</a> </li><li class="li-toc"><a href="extn.html#sec224">7.9.3  Private row types</a> </li></ul> </li><li class="li-toc"><a href="extn.html#sec225">7.10  Local opens</a> </li><li class="li-toc"><a href="extn.html#sec226">7.11  Record notations</a> </li><li class="li-toc"><a href="extn.html#sec227">7.12  Explicit polymorphic type annotations</a> </li><li class="li-toc"><a href="extn.html#sec228">7.13  Locally abstract types</a> </li><li class="li-toc"><a href="extn.html#sec230">7.14  First-class modules</a> </li><li class="li-toc"><a href="extn.html#sec233">7.15  Recovering the type of a module</a> </li><li class="li-toc"><a href="extn.html#sec234">7.16  Substituting inside a signature</a> </li><li class="li-toc"><a href="extn.html#sec235">7.17  Explicit overriding in class definitions</a> </li><li class="li-toc"><a href="extn.html#sec236">7.18  Overriding in open statements</a> </li><li class="li-toc"><a href="extn.html#sec237">7.19  Generalized algebraic datatypes</a> </li><li class="li-toc"><a href="extn.html#sec239">7.20  Syntax for Bigarray access</a> </li></ul> </li></ul> </li><li class="li-toc"><a href="index.html#sec240">Part III  The OCaml tools</a> <ul class="ftoc2"><li class="li-toc"> <a href="comp.html#sec241">Chapter 8  Batch compilation (ocamlc)</a> <ul class="ftoc3"><li class="li-toc"> <a href="comp.html#sec242">8.1  Overview of the compiler</a> </li><li class="li-toc"><a href="comp.html#sec243">8.2  Options</a> </li><li class="li-toc"><a href="comp.html#sec244">8.3  Modules and the file system</a> </li><li class="li-toc"><a href="comp.html#sec245">8.4  Common errors</a> </li></ul> </li><li class="li-toc"><a href="toplevel.html#sec246">Chapter 9  The toplevel system (ocaml)</a> <ul class="ftoc3"><li class="li-toc"> <a href="toplevel.html#sec247">9.1  Options</a> </li><li class="li-toc"><a href="toplevel.html#sec248">9.2  Toplevel directives</a> </li><li class="li-toc"><a href="toplevel.html#sec249">9.3  The toplevel and the module system</a> </li><li class="li-toc"><a href="toplevel.html#sec250">9.4  Common errors</a> </li><li class="li-toc"><a href="toplevel.html#sec251">9.5  Building custom toplevel systems: <span class="c007">ocamlmktop</span></a> </li><li class="li-toc"><a href="toplevel.html#sec252">9.6  Options</a> </li></ul> </li><li class="li-toc"><a href="runtime.html#sec253">Chapter 10  The runtime system (ocamlrun)</a> <ul class="ftoc3"><li class="li-toc"> <a href="runtime.html#sec254">10.1  Overview</a> </li><li class="li-toc"><a href="runtime.html#sec255">10.2  Options</a> </li><li class="li-toc"><a href="runtime.html#sec256">10.3  Dynamic loading of shared libraries</a> </li><li class="li-toc"><a href="runtime.html#sec257">10.4  Common errors</a> </li></ul> </li><li class="li-toc"><a href="native.html#sec258">Chapter 11  Native-code compilation (ocamlopt)</a> <ul class="ftoc3"><li class="li-toc"> <a href="native.html#sec259">11.1  Overview of the compiler</a> </li><li class="li-toc"><a href="native.html#sec260">11.2  Options</a> </li><li class="li-toc"><a href="native.html#sec264">11.3  Common errors</a> </li><li class="li-toc"><a href="native.html#sec265">11.4  Running executables produced by ocamlopt</a> </li><li class="li-toc"><a href="native.html#sec266">11.5  Compatibility with the bytecode compiler</a> </li></ul> </li><li class="li-toc"><a href="lexyacc.html#sec267">Chapter 12  Lexer and parser generators (ocamllex, ocamlyacc)</a> <ul class="ftoc3"><li class="li-toc"> <a href="lexyacc.html#sec268">12.1  Overview of <span class="c007">ocamllex</span></a> <ul class="ftoc4"><li class="li-toc"> <a href="lexyacc.html#sec269">12.1.1  Options</a> </li></ul> </li><li class="li-toc"><a href="lexyacc.html#sec270">12.2  Syntax of lexer definitions</a> <ul class="ftoc4"><li class="li-toc"> <a href="lexyacc.html#sec271">12.2.1  Header and trailer</a> </li><li class="li-toc"><a href="lexyacc.html#sec272">12.2.2  Naming regular expressions</a> </li><li class="li-toc"><a href="lexyacc.html#sec273">12.2.3  Entry points</a> </li><li class="li-toc"><a href="lexyacc.html#sec274">12.2.4  Regular expressions</a> </li><li class="li-toc"><a href="lexyacc.html#sec275">12.2.5  Actions</a> </li><li class="li-toc"><a href="lexyacc.html#sec276">12.2.6  Variables in regular expressions</a> </li><li class="li-toc"><a href="lexyacc.html#sec277">12.2.7  Reserved identifiers</a> </li></ul> </li><li class="li-toc"><a href="lexyacc.html#sec278">12.3  Overview of <span class="c007">ocamlyacc</span></a> </li><li class="li-toc"><a href="lexyacc.html#sec279">12.4  Syntax of grammar definitions</a> <ul class="ftoc4"><li class="li-toc"> <a href="lexyacc.html#sec280">12.4.1  Header and trailer</a> </li><li class="li-toc"><a href="lexyacc.html#sec281">12.4.2  Declarations</a> </li><li class="li-toc"><a href="lexyacc.html#sec282">12.4.3  Rules</a> </li><li class="li-toc"><a href="lexyacc.html#sec283">12.4.4  Error handling</a> </li></ul> </li><li class="li-toc"><a href="lexyacc.html#sec284">12.5  Options</a> </li><li class="li-toc"><a href="lexyacc.html#sec285">12.6  A complete example</a> </li><li class="li-toc"><a href="lexyacc.html#sec286">12.7  Common errors</a> </li></ul> </li><li class="li-toc"><a href="depend.html#sec287">Chapter 13  Dependency generator (ocamldep)</a> <ul class="ftoc3"><li class="li-toc"> <a href="depend.html#sec288">13.1  Options</a> </li><li class="li-toc"><a href="depend.html#sec289">13.2  A typical Makefile</a> </li></ul> </li><li class="li-toc"><a href="browser.html#sec290">Chapter 14  The browser/editor (ocamlbrowser)</a> <ul class="ftoc3"><li class="li-toc"> <a href="browser.html#sec291">14.1  Invocation</a> </li><li class="li-toc"><a href="browser.html#sec292">14.2  Viewer</a> </li><li class="li-toc"><a href="browser.html#sec293">14.3  Module browsing</a> </li><li class="li-toc"><a href="browser.html#sec294">14.4  File editor</a> </li><li class="li-toc"><a href="browser.html#sec295">14.5  Shell</a> </li></ul> </li><li class="li-toc"><a href="ocamldoc.html#sec296">Chapter 15  The documentation generator (ocamldoc)</a> <ul class="ftoc3"><li class="li-toc"> <a href="ocamldoc.html#sec297">15.1  Usage</a> <ul class="ftoc4"><li class="li-toc"> <a href="ocamldoc.html#sec298">15.1.1  Invocation</a> </li><li class="li-toc"><a href="ocamldoc.html#sec307">15.1.2  Merging of module information</a> </li><li class="li-toc"><a href="ocamldoc.html#sec308">15.1.3  Coding rules</a> </li></ul> </li><li class="li-toc"><a href="ocamldoc.html#sec309">15.2  Syntax of documentation comments</a> <ul class="ftoc4"><li class="li-toc"> <a href="ocamldoc.html#sec310">15.2.1  Placement of documentation comments</a> </li><li class="li-toc"><a href="ocamldoc.html#sec313">15.2.2  The Stop special comment</a> </li><li class="li-toc"><a href="ocamldoc.html#sec314">15.2.3  Syntax of documentation comments</a> </li><li class="li-toc"><a href="ocamldoc.html#sec315">15.2.4  Text formatting</a> </li><li class="li-toc"><a href="ocamldoc.html#sec321">15.2.5  Documentation tags (@-tags)</a> </li></ul> </li><li class="li-toc"><a href="ocamldoc.html#sec324">15.3  Custom generators</a> <ul class="ftoc4"><li class="li-toc"> <a href="ocamldoc.html#sec325">15.3.1  The generator modules</a> </li><li class="li-toc"><a href="ocamldoc.html#sec326">15.3.2  Handling custom tags</a> </li></ul> </li><li class="li-toc"><a href="ocamldoc.html#sec329">15.4  Adding command line options</a> <ul class="ftoc4"><li class="li-toc"> <a href="ocamldoc.html#sec330">15.4.1  Compilation and usage</a> </li></ul> </li></ul> </li><li class="li-toc"><a href="debugger.html#sec333">Chapter 16  The debugger (ocamldebug)</a> <ul class="ftoc3"><li class="li-toc"> <a href="debugger.html#sec334">16.1  Compiling for debugging</a> </li><li class="li-toc"><a href="debugger.html#sec335">16.2  Invocation</a> <ul class="ftoc4"><li class="li-toc"> <a href="debugger.html#sec336">16.2.1  Starting the debugger</a> </li><li class="li-toc"><a href="debugger.html#sec337">16.2.2  Exiting the debugger</a> </li></ul> </li><li class="li-toc"><a href="debugger.html#sec338">16.3  Commands</a> <ul class="ftoc4"><li class="li-toc"> <a href="debugger.html#sec339">16.3.1  Getting help</a> </li><li class="li-toc"><a href="debugger.html#sec340">16.3.2  Accessing the debugger state</a> </li></ul> </li><li class="li-toc"><a href="debugger.html#sec341">16.4  Executing a program</a> <ul class="ftoc4"><li class="li-toc"> <a href="debugger.html#sec342">16.4.1  Events</a> </li><li class="li-toc"><a href="debugger.html#sec343">16.4.2  Starting the debugged program</a> </li><li class="li-toc"><a href="debugger.html#sec344">16.4.3  Running the program</a> </li><li class="li-toc"><a href="debugger.html#sec345">16.4.4  Time travel</a> </li><li class="li-toc"><a href="debugger.html#sec346">16.4.5  Killing the program</a> </li></ul> </li><li class="li-toc"><a href="debugger.html#sec347">16.5  Breakpoints</a> </li><li class="li-toc"><a href="debugger.html#sec348">16.6  The call stack</a> </li><li class="li-toc"><a href="debugger.html#sec349">16.7  Examining variable values</a> </li><li class="li-toc"><a href="debugger.html#sec350">16.8  Controlling the debugger</a> <ul class="ftoc4"><li class="li-toc"> <a href="debugger.html#sec351">16.8.1  Setting the program name and arguments</a> </li><li class="li-toc"><a href="debugger.html#sec352">16.8.2  How programs are loaded</a> </li><li class="li-toc"><a href="debugger.html#sec353">16.8.3  Search path for files</a> </li><li class="li-toc"><a href="debugger.html#sec354">16.8.4  Working directory</a> </li><li class="li-toc"><a href="debugger.html#sec355">16.8.5  Turning reverse execution on and off</a> </li><li class="li-toc"><a href="debugger.html#sec356">16.8.6  Communication between the debugger and the program</a> </li><li class="li-toc"><a href="debugger.html#sec357">16.8.7  Fine-tuning the debugger</a> </li><li class="li-toc"><a href="debugger.html#sec358">16.8.8  User-defined printers</a> </li></ul> </li><li class="li-toc"><a href="debugger.html#sec359">16.9  Miscellaneous commands</a> </li><li class="li-toc"><a href="debugger.html#sec360">16.10  Running the debugger under Emacs</a> </li></ul> </li><li class="li-toc"><a href="profil.html#sec361">Chapter 17  Profiling (ocamlprof)</a> <ul class="ftoc3"><li class="li-toc"> <a href="profil.html#sec362">17.1  Compiling for profiling</a> </li><li class="li-toc"><a href="profil.html#sec366">17.2  Profiling an execution</a> </li><li class="li-toc"><a href="profil.html#sec367">17.3  Printing profiling information</a> </li><li class="li-toc"><a href="profil.html#sec368">17.4  Time profiling</a> </li></ul> </li><li class="li-toc"><a href="ocamlbuild.html#sec370">Chapter 18  The ocamlbuild compilation manager</a> <ul class="ftoc3"><li class="li-toc"> <a href="ocamlbuild.html#sec371">18.1  Features of <span class="c007">ocamlbuild</span></a> </li><li class="li-toc"><a href="ocamlbuild.html#sec372">18.2  Limitations</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec373">18.3  Using <span class="c007">ocamlbuild</span></a> <ul class="ftoc4"><li class="li-toc"> <a href="ocamlbuild.html#sec374">18.3.1  Hygiene & where is my code ?</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec375">18.3.2  Hello, world !</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec376">18.3.3  Executing my code</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec377">18.3.4  The log file, verbosity and debugging</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec378">18.3.5  Cleaning</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec379">18.3.6  Where and how to run <span class="c007">ocamlbuild</span>?</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec380">18.3.7  Dependencies</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec381">18.3.8  Native and byte-code</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec382">18.3.9  Compile flags</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec383">18.3.10  Link flags</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec384">18.3.11  Linking with external libraries</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec385">18.3.12  The <span class="c007">_tags</span> files</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec387">18.3.13  Glob patterns and expressions</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec388">18.3.14  Subdirectories</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec390">18.3.15  Grouping targets with <span class="c007">.itarget</span></a> </li><li class="li-toc"><a href="ocamlbuild.html#sec391">18.3.16  Packing subdirectories into modules</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec392">18.3.17  Making an OCaml library</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec393">18.3.18  Making an OCaml toplevel</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec394">18.3.19  Preprocessor options and tags</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec395">18.3.20  Debugging byte code and profiling native code</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec396">18.3.21  Generating documentation using <span class="c007">ocamldoc</span></a> </li><li class="li-toc"><a href="ocamlbuild.html#sec397">18.3.22  The display line</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec398">18.3.23  <span class="c007">ocamllex</span>, <span class="c007">ocamlyacc</span> and <span class="c007">menhir</span></a> </li><li class="li-toc"><a href="ocamlbuild.html#sec399">18.3.24  Changing the compilers or tools</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec400">18.3.25  Interaction with version control systems</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec401">18.3.26  A shell script for driving it all?</a> </li></ul> </li><li class="li-toc"><a href="ocamlbuild.html#sec402">18.4  Appendix: Motivations</a> </li><li class="li-toc"><a href="ocamlbuild.html#sec403">18.5  Appendix: Summary of default rules</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec404">Chapter 19  Interfacing C with OCaml</a> <ul class="ftoc3"><li class="li-toc"> <a href="intfc.html#sec405">19.1  Overview and compilation information</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec406">19.1.1  Declaring primitives</a> </li><li class="li-toc"><a href="intfc.html#sec407">19.1.2  Implementing primitives</a> </li><li class="li-toc"><a href="intfc.html#sec408">19.1.3  Statically linking C code with OCaml code</a> </li><li class="li-toc"><a href="intfc.html#sec409">19.1.4  Dynamically linking C code with OCaml code</a> </li><li class="li-toc"><a href="intfc.html#sec410">19.1.5  Choosing between static linking and dynamic linking</a> </li><li class="li-toc"><a href="intfc.html#sec411">19.1.6  Building standalone custom runtime systems</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec412">19.2  The <span class="c007">value</span> type</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec413">19.2.1  Integer values</a> </li><li class="li-toc"><a href="intfc.html#sec414">19.2.2  Blocks</a> </li><li class="li-toc"><a href="intfc.html#sec415">19.2.3  Pointers outside the heap</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec416">19.3  Representation of OCaml data types</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec417">19.3.1  Atomic types</a> </li><li class="li-toc"><a href="intfc.html#sec418">19.3.2  Tuples and records</a> </li><li class="li-toc"><a href="intfc.html#sec419">19.3.3  Arrays</a> </li><li class="li-toc"><a href="intfc.html#sec420">19.3.4  Concrete data types</a> </li><li class="li-toc"><a href="intfc.html#sec421">19.3.5  Objects</a> </li><li class="li-toc"><a href="intfc.html#sec422">19.3.6  Polymorphic variants</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec423">19.4  Operations on values</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec424">19.4.1  Kind tests</a> </li><li class="li-toc"><a href="intfc.html#sec425">19.4.2  Operations on integers</a> </li><li class="li-toc"><a href="intfc.html#sec426">19.4.3  Accessing blocks</a> </li><li class="li-toc"><a href="intfc.html#sec427">19.4.4  Allocating blocks</a> </li><li class="li-toc"><a href="intfc.html#sec430">19.4.5  Raising exceptions</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec431">19.5  Living in harmony with the garbage collector</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec432">19.5.1  Simple interface</a> </li><li class="li-toc"><a href="intfc.html#sec437">19.5.2  Low-level interface</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec438">19.6  A complete example</a> </li><li class="li-toc"><a href="intfc.html#sec439">19.7  Advanced topic: callbacks from C to OCaml</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec440">19.7.1  Applying OCaml closures from C</a> </li><li class="li-toc"><a href="intfc.html#sec442">19.7.2  Obtaining or registering OCaml closures for use in C functions</a> </li><li class="li-toc"><a href="intfc.html#sec443">19.7.3  Registering OCaml exceptions for use in C functions</a> </li><li class="li-toc"><a href="intfc.html#sec444">19.7.4  Main program in C</a> </li><li class="li-toc"><a href="intfc.html#sec445">19.7.5  Embedding the OCaml code in the C code</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec448">19.8  Advanced example with callbacks</a> </li><li class="li-toc"><a href="intfc.html#sec449">19.9  Advanced topic: custom blocks</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec450">19.9.1  The <span class="c007">struct custom_operations</span></a> </li><li class="li-toc"><a href="intfc.html#sec451">19.9.2  Allocating custom blocks</a> </li><li class="li-toc"><a href="intfc.html#sec452">19.9.3  Accessing custom blocks</a> </li><li class="li-toc"><a href="intfc.html#sec453">19.9.4  Writing custom serialization and deserialization functions</a> </li><li class="li-toc"><a href="intfc.html#sec454">19.9.5  Choosing identifiers</a> </li><li class="li-toc"><a href="intfc.html#sec455">19.9.6  Finalized blocks</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec456">19.10  Advanced topic: multithreading</a> <ul class="ftoc4"><li class="li-toc"> <a href="intfc.html#sec457">19.10.1  Registering threads created from C</a> </li><li class="li-toc"><a href="intfc.html#sec458">19.10.2  Parallel execution of long-running C code</a> </li></ul> </li><li class="li-toc"><a href="intfc.html#sec459">19.11  Building mixed C/OCaml libraries: <span class="c007">ocamlmklib</span></a> </li></ul> </li></ul> </li><li class="li-toc"><a href="index.html#sec461">Part IV  The OCaml library</a> <ul class="ftoc2"><li class="li-toc"> <a href="core.html#sec462">Chapter 20  The core library</a> <ul class="ftoc3"><li class="li-toc"> <a href="core.html#sec464">20.1  Built-in types and predefined exceptions</a> </li><li class="li-toc"><a href="core.html#sec467">20.2  Module <span class="c007">Pervasives</span>: the initially opened module</a> </li></ul> </li><li class="li-toc"><a href="stdlib.html#sec468">Chapter 21  The standard library</a> </li><li class="li-toc"><a href="libunix.html#sec470">Chapter 22  The unix library: Unix system calls</a> </li><li class="li-toc"><a href="libnum.html#sec471">Chapter 23  The num library: arbitrary-precision rational arithmetic</a> </li><li class="li-toc"><a href="libstr.html#sec472">Chapter 24  The str library: regular expressions and string processing</a> </li><li class="li-toc"><a href="libthreads.html#sec473">Chapter 25  The threads library</a> </li><li class="li-toc"><a href="libgraph.html#sec474">Chapter 26  The graphics library</a> </li><li class="li-toc"><a href="libdynlink.html#sec475">Chapter 27  The dynlink library: dynamic loading and linking of object files</a> </li><li class="li-toc"><a href="liblabltk.html#sec476">Chapter 28  The LablTk library: Tcl/Tk GUI interface</a> </li><li class="li-toc"><a href="libbigarray.html#sec477">Chapter 29  The bigarray library</a> <ul class="ftoc3"><li class="li-toc"> <a href="libbigarray.html#sec478">29.1  Module <span class="c007">Bigarray</span>: large, multi-dimensional, numerical arrays</a> </li><li class="li-toc"><a href="libbigarray.html#sec479">29.2  Big arrays in the OCaml-C interface</a> <ul class="ftoc4"><li class="li-toc"> <a href="libbigarray.html#sec480">29.2.1  Include file</a> </li><li class="li-toc"><a href="libbigarray.html#sec481">29.2.2  Accessing an OCaml bigarray from C or Fortran</a> </li><li class="li-toc"><a href="libbigarray.html#sec482">29.2.3  Wrapping a C or Fortran array as an OCaml big array</a> </li></ul> </li></ul> </li></ul> </li><li class="li-toc"><a href="index.html#sec483">Part V  Appendix</a> </li></ul><hr> <a href="index.html"><img src="contents_motif.gif" alt="Up"></a> <a href="foreword.html"><img src="next_motif.gif" alt="Next"></a> </body> </html>