~ubuntu-branches/ubuntu/hardy/ocaml-doc/hardy

« back to all changes in this revision

Viewing changes to ocaml.html/manual023.html

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2007-09-08 01:49:22 UTC
  • mfrom: (0.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070908014922-lvihyehz0ndq7suu
Tags: 3.10-1
* New upstream release.
* Removed camlp4 documentation since it is not up-to-date.
* Updated to standards version 3.7.2, no changes needed.
* Updated my email address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
<HTML>
4
4
<HEAD>
5
5
 
6
 
 
7
 
 
8
6
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
9
 
<META name="GENERATOR" content="hevea 1.08">
 
7
<META name="GENERATOR" content="hevea 1.09">
10
8
<LINK rel="stylesheet" type="text/css" href="manual.css">
11
 
<TITLE>
12
 
The toplevel system (ocaml)
13
 
</TITLE>
 
9
<TITLE>The toplevel system (ocaml)</TITLE>
14
10
</HEAD>
15
11
<BODY >
16
 
<A HREF="manual022.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
17
 
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
18
 
<A HREF="manual024.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
 
12
<A HREF="manual022.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
 
13
<A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
 
14
<A HREF="manual024.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
19
15
<HR>
20
 
 
21
 
<H1 CLASS="chapter"><A NAME="htoc108">Chapter&nbsp;9</A>&nbsp;&nbsp;The toplevel system (ocaml)</H1> <A NAME="c:camllight"></A>
22
 
 
23
 
This chapter describes the toplevel system for Objective Caml, that permits interactive use of the Objective Caml system
 
16
<H1 CLASS="chapter"><A NAME="htoc108">Chapter�9</A>��The toplevel system (ocaml)</H1><P> <A NAME="c:camllight"></A>
 
17
</P><P>This chapter describes the toplevel system for Objective Caml, that permits interactive use of the Objective Caml system
24
18
through a read-eval-print loop. In this mode, the system repeatedly
25
19
reads Caml phrases from the input, then typechecks, compile and
26
20
evaluate them, then prints the inferred type and result value, if
27
21
any. The system prints a <TT>#</TT> (sharp) prompt before reading each
28
 
phrase.<BR>
29
 
<BR>
30
 
Input to the toplevel can span several lines. It is terminated by <TT>;;</TT> (a
 
22
phrase.</P><P>Input to the toplevel can span several lines. It is terminated by <TT>;;</TT> (a
31
23
double-semicolon). The toplevel input consists in one or several
32
 
toplevel phrases, with the following syntax:<BR>
33
 
<BR>
34
 
<DIV CLASS="center"><TABLE CELLSPACING=2 CELLPADDING=0>
35
 
<TR><TD ALIGN=right NOWRAP>
36
 
<A NAME="toplevel-input"></A>
37
 
<FONT COLOR=maroon><I><TT>toplevel-input</TT></I></FONT></TD>
38
 
<TD ALIGN=right NOWRAP>::=</TD>
39
 
<TD ALIGN=left NOWRAP>
40
 
 { <FONT COLOR=maroon><I><a href="#toplevel-phrase"><font color=maroon><TT>toplevel-phrase</TT></font></a></I></FONT> } <FONT COLOR=blue><TT>;;</TT></FONT></TD>
41
 
</TR>
42
 
<TR><TD ALIGN=right NOWRAP>
43
 
<A NAME="toplevel-phrase"></A>
44
 
<FONT COLOR=maroon><I><TT>toplevel-phrase</TT></I></FONT></TD>
45
 
<TD ALIGN=right NOWRAP>::=</TD>
46
 
<TD ALIGN=left NOWRAP>
47
 
 <FONT COLOR=maroon><I><a href="#toplevel-definition"><font color=maroon><TT>toplevel-definition</TT></font></a></I></FONT></TD>
48
 
</TR>
49
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
50
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
51
 
<TD ALIGN=left NOWRAP> <FONT COLOR=maroon><I><a href="manual015.html#expr"><font color=maroon><TT>expr</TT></font></a></I></FONT></TD>
52
 
</TR>
53
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
54
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
55
 
<TD ALIGN=left NOWRAP> <FONT COLOR=blue><TT>#</TT></FONT> <FONT COLOR=maroon><I><a href="manual009.html#ident"><font color=maroon><TT>ident</TT></font></a> &nbsp;<a href="#directive-argument"><font color=maroon><TT>directive-argument</TT></font></a></I></FONT></TD>
56
 
</TR>
57
 
<TR><TD ALIGN=right NOWRAP>
58
 
<A NAME="toplevel-definition"></A>
59
 
<FONT COLOR=maroon><I><TT>toplevel-definition</TT></I></FONT></TD>
60
 
<TD ALIGN=right NOWRAP>::=</TD>
61
 
<TD ALIGN=left NOWRAP>
62
 
 <FONT COLOR=blue><TT>let</TT></FONT> [<FONT COLOR=blue><TT>rec</TT></FONT>] <FONT COLOR=maroon><I><a href="manual015.html#let-binding"><font color=maroon><TT>let-binding</TT></font></a></I></FONT> &nbsp;{ <FONT COLOR=blue><TT>and</TT></FONT> <FONT COLOR=maroon><I><a href="manual015.html#let-binding"><font color=maroon><TT>let-binding</TT></font></a></I></FONT> }</TD>
63
 
</TR>
64
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
65
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
66
 
<TD ALIGN=left NOWRAP> <FONT COLOR=blue><TT>external</TT></FONT> <FONT COLOR=maroon><TT><a href="manual011.html#value-name"><font color=maroon><I>value-name</I></font></a></TT> <FONT COLOR=blue><TT>:</TT></FONT> &nbsp;<TT><a href="manual012.html#typexpr"><font color=maroon><I>typexpr</I></font></a></TT> <FONT COLOR=blue><TT>=</TT></FONT> &nbsp;<TT><I>external-declaration</I></TT></FONT></TD>
67
 
</TR>
68
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
69
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
70
 
<TD ALIGN=left NOWRAP> <FONT COLOR=maroon><I><a href="manual016.html#type-definition"><font color=maroon><TT>type-definition</TT></font></a></I></FONT></TD>
71
 
</TR>
72
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
73
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
74
 
<TD ALIGN=left NOWRAP> <FONT COLOR=maroon><I><a href="manual016.html#exception-definition"><font color=maroon><TT>exception-definition</TT></font></a></I></FONT></TD>
75
 
</TR>
76
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
77
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
78
 
<TD ALIGN=left NOWRAP> <FONT COLOR=blue><TT>module</TT></FONT> <FONT COLOR=maroon><I><a href="manual011.html#module-name"><font color=maroon><TT>module-name</TT></font></a></I></FONT> &nbsp;[ <FONT COLOR=blue><TT>:</TT></FONT> <FONT COLOR=maroon><I><a href="manual018.html#module-type"><font color=maroon><TT>module-type</TT></font></a></I></FONT> ] <FONT COLOR=blue><TT>=</TT></FONT> &nbsp;<FONT COLOR=maroon><I><a href="manual019.html#module-expr"><font color=maroon><TT>module-expr</TT></font></a></I></FONT></TD>
79
 
</TR>
80
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
81
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
82
 
<TD ALIGN=left NOWRAP> <FONT COLOR=blue><TT>module</TT></FONT> <FONT COLOR=blue><TT>type</TT></FONT> <FONT COLOR=maroon><TT><a href="manual011.html#modtype-name"><font color=maroon><I>modtype-name</I></font></a></TT> <FONT COLOR=blue><TT>=</TT></FONT> &nbsp;<TT><a href="manual018.html#module-type"><font color=maroon><I>module-type</I></font></a></TT></FONT></TD>
83
 
</TR>
84
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
85
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
86
 
<TD ALIGN=left NOWRAP> <FONT COLOR=blue><TT>open</TT></FONT> <FONT COLOR=maroon><I><a href="manual011.html#module-path"><font color=maroon><TT>module-path</TT></font></a></I></FONT></TD>
87
 
</TR>
88
 
<TR><TD ALIGN=right NOWRAP>
89
 
<A NAME="directive-argument"></A>
90
 
<FONT COLOR=maroon><I><TT>directive-argument</TT></I></FONT></TD>
91
 
<TD ALIGN=right NOWRAP>::=</TD>
92
 
<TD ALIGN=left NOWRAP>
93
 
 <FONT COLOR=maroon><I><TT>nothing</TT></I></FONT></TD>
94
 
</TR>
95
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
96
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
97
 
<TD ALIGN=left NOWRAP> <FONT COLOR=maroon><I><a href="manual009.html#string-literal"><font color=maroon><TT>string-literal</TT></font></a></I></FONT></TD>
98
 
</TR>
99
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
100
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
101
 
<TD ALIGN=left NOWRAP> <FONT COLOR=maroon><I><a href="manual009.html#integer-literal"><font color=maroon><TT>integer-literal</TT></font></a></I></FONT></TD>
102
 
</TR>
103
 
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
104
 
<TD ALIGN=right NOWRAP>&#8739;</TD>
105
 
<TD ALIGN=left NOWRAP> <FONT COLOR=maroon><I><a href="manual011.html#value-path"><font color=maroon><TT>value-path</TT></font></a></I></FONT></TD>
106
 
</TR></TABLE></DIV><BR>
107
 
<BR>
108
 
A phrase can consist of a definition, similar to those found in
109
 
implementations of compilation units or in <FONT COLOR=blue><TT>struct</TT></FONT> &hellip; <FONT COLOR=blue><TT>end</TT></FONT>
 
24
toplevel phrases, with the following syntax:</P><TABLE CLASS="display dcenter"><TR VALIGN="middle"><TD CLASS="dcell"><TABLE CELLSPACING=6 CELLPADDING=0><TR><TD ALIGN=right NOWRAP>
 
25
<I><A NAME="toplevel-input"><FONT COLOR=maroon>toplevel-input</FONT></A></I></TD><TD ALIGN=center NOWRAP>::=</TD><TD ALIGN=left NOWRAP>
 
26
{�<I><A HREF="#toplevel-phrase"><FONT COLOR=maroon>toplevel-phrase</FONT></A></I>�}�<FONT COLOR=blue><TT>;;</TT></FONT>
 
27
�</TD></TR>
 
28
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD></TR>
 
29
<TR><TD ALIGN=right NOWRAP>
 
30
<I><A NAME="toplevel-phrase"><FONT COLOR=maroon>toplevel-phrase</FONT></A></I></TD><TD ALIGN=center NOWRAP>::=</TD><TD ALIGN=left NOWRAP>
 
31
<I><A HREF="manual019.html#definition"><FONT COLOR=maroon>definition</FONT></A></I>
 
32
�</TD></TR>
 
33
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD><TD ALIGN=center NOWRAP>&#X2223;</TD><TD ALIGN=left NOWRAP>�<I><A HREF="expr.html#expr"><FONT COLOR=maroon>expr</FONT></A></I>
 
34
�</TD></TR>
 
35
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD><TD ALIGN=center NOWRAP>&#X2223;</TD><TD ALIGN=left NOWRAP>�<FONT COLOR=blue><TT>#</TT></FONT>�<I><A HREF="lex.html#ident"><FONT COLOR=maroon>ident</FONT></A></I>��<I><A HREF="#directive-argument"><FONT COLOR=maroon>directive-argument</FONT></A></I>
 
36
�</TD></TR>
 
37
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD></TR>
 
38
<TR><TD ALIGN=right NOWRAP>
 
39
<I><A NAME="directive-argument"><FONT COLOR=maroon>directive-argument</FONT></A></I></TD><TD ALIGN=center NOWRAP>::=</TD><TD ALIGN=left NOWRAP>
 
40
&#X454;
 
41
�</TD></TR>
 
42
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD><TD ALIGN=center NOWRAP>&#X2223;</TD><TD ALIGN=left NOWRAP>�<I><A HREF="lex.html#string-literal"><FONT COLOR=maroon>string-literal</FONT></A></I>
 
43
�</TD></TR>
 
44
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD><TD ALIGN=center NOWRAP>&#X2223;</TD><TD ALIGN=left NOWRAP>�<I><A HREF="lex.html#integer-literal"><FONT COLOR=maroon>integer-literal</FONT></A></I>
 
45
�</TD></TR>
 
46
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD><TD ALIGN=center NOWRAP>&#X2223;</TD><TD ALIGN=left NOWRAP>�<I><A HREF="manual011.html#value-path"><FONT COLOR=maroon>value-path</FONT></A></I>
 
47
�</TD></TR>
 
48
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD></TR>
 
49
</TABLE></TD></TR>
 
50
</TABLE><P>A phrase can consist of a definition, similar to those found in
 
51
implementations of compilation units or in <FONT COLOR=blue><TT>struct</TT></FONT> &#X2026; <FONT COLOR=blue><TT>end</TT></FONT>
110
52
module expressions. The definition can bind value names, type names,
111
53
an exception, a module name, or a module type name. The toplevel
112
54
system performs the bindings, then prints the types and values (if
113
 
any) for the names thus defined.<BR>
114
 
<BR>
115
 
A phrase may also consist in a <TT>open</TT> directive (see
116
 
section&nbsp;<A HREF="manual019.html#s:module-expr">6.11</A>), or a value expression
117
 
(section&nbsp;<A HREF="manual015.html#s:value-expr">6.7</A>). Expressions are simply evaluated,
 
55
any) for the names thus defined.</P><P>A phrase may also consist in a <TT>open</TT> directive (see
 
56
section�<A HREF="manual019.html#s:module-expr">6.11</A>), or a value expression
 
57
(section�<A HREF="expr.html#s:value-expr">6.7</A>). Expressions are simply evaluated,
118
58
without performing any bindings, and the value of the expression is
119
 
printed.<BR>
120
 
<BR>
121
 
Finally, a phrase can also consist in a toplevel directive,
 
59
printed.</P><P>Finally, a phrase can also consist in a toplevel directive,
122
60
starting with <TT>#</TT> (the sharp sign). These directives control the
123
61
behavior of the toplevel; they are listed below in
124
 
section&nbsp;<A HREF="#s:toplevel-directives">9.2</A>.<BR>
125
 
<BR>
126
 
 
127
 
&nbsp;&nbsp;<FONT COLOR=purple>Unix:</FONT>
128
 
<BLOCKQUOTE CLASS="quote">
 
62
section�<A HREF="#s:toplevel-directives">9.2</A>.</P><BLOCKQUOTE CLASS="quote"><FONT COLOR=purple>Unix:</FONT>��
129
63
The toplevel system is started by the command <TT>ocaml</TT>, as follows:
130
64
<PRE>
131
65
        ocaml <I>options objects</I>                # interactive mode
134
68
<I>options</I> are described below.
135
69
<I>objects</I> are filenames ending in <TT>.cmo</TT> or <TT>.cma</TT>; they are
136
70
loaded into the interpreter immediately after <I>options</I> are set.
137
 
<I>scriptfile</I> is any file name not ending in <TT>.cmo</TT> or <TT>.cma</TT>.<BR>
138
 
<BR>
139
 
If no <I>scriptfile</I> is given on the command line, the toplevel system
 
71
<I>scriptfile</I> is any file name not ending in <TT>.cmo</TT> or <TT>.cma</TT>.<P>If no <I>scriptfile</I> is given on the command line, the toplevel system
140
72
enters interactive mode: phrases are read on standard input, results
141
73
are printed on standard output, errors on standard error. End-of-file
142
74
on standard input terminates <TT>ocaml</TT> (see also the <TT>#quit</TT> directive
143
 
in section&nbsp;<A HREF="#s:toplevel-directives">9.2</A>).<BR>
144
 
<BR>
145
 
On start-up (before the first phrase is read), if the file
 
75
in section�<A HREF="#s:toplevel-directives">9.2</A>).</P><P>On start-up (before the first phrase is read), if the file
146
76
<TT>.ocamlinit</TT> exists in the current directory,
147
77
its contents are read as a sequence of Objective Caml phrases
148
78
and executed as per the <TT>#use</TT> directive
149
 
described in section&nbsp;<A HREF="#s:toplevel-directives">9.2</A>.
 
79
described in section�<A HREF="#s:toplevel-directives">9.2</A>.
150
80
The evaluation outcode for each phrase are not displayed.
151
81
If the current directory does not contain an <TT>.ocamlinit</TT> file, but
152
82
the user's home directory (environment variable <TT>HOME</TT>) does, the
153
 
latter is read and executed as described below.<BR>
154
 
<BR>
155
 
The toplevel system does not perform line editing, but it can
 
83
latter is read and executed as described below.</P><P>The toplevel system does not perform line editing, but it can
156
84
easily be used in conjunction with an external line editor such as
157
85
<TT>ledit</TT>, <TT>ocaml2</TT> or <TT>rlwrap</TT>
158
86
 
161
89
<A HREF="http://caml.inria.fr/humps/index_framed_caml.html">Caml Hump</A>).
162
90
 
163
91
Another option is to use <TT>ocaml</TT> under Gnu Emacs, which gives the
164
 
full editing power of Emacs (command <TT>run-caml</TT> from library <TT>inf-caml</TT>).<BR>
165
 
<BR>
166
 
At any point, the parsing, compilation or evaluation of the current
 
92
full editing power of Emacs (command <TT>run-caml</TT> from library <TT>inf-caml</TT>).</P><P>At any point, the parsing, compilation or evaluation of the current
167
93
phrase can be interrupted by pressing <TT>ctrl-C</TT> (or, more precisely,
168
94
by sending the <TT>INTR</TT> signal to the <TT>ocaml</TT> process). The toplevel
169
 
then immediately returns to the <TT>#</TT> prompt.<BR>
170
 
<BR>
171
 
If <I>scriptfile</I> is given on the command-line to <TT>ocaml</TT>, the toplevel
 
95
then immediately returns to the <TT>#</TT> prompt.</P><P>If <I>scriptfile</I> is given on the command-line to <TT>ocaml</TT>, the toplevel
172
96
system enters script mode: the contents of the file are read as a
173
97
sequence of Objective Caml phrases and executed, as per the <TT>#use</TT>
174
 
directive (section&nbsp;<A HREF="#s:toplevel-directives">9.2</A>). The outcome of the
 
98
directive (section�<A HREF="#s:toplevel-directives">9.2</A>). The outcome of the
175
99
evaluation is not printed. On reaching the end of file, the <TT>ocaml</TT>
176
100
command exits immediately. No commands are read from standard input.
177
101
<TT>Sys.argv</TT> is transformed, ignoring all Objective Caml parameters, and
178
 
starting with the script file name in <TT>Sys.argv.(0)</TT>.<BR>
179
 
<BR>
180
 
In script mode, the first line of the script is ignored if it starts
 
102
starting with the script file name in <TT>Sys.argv.(0)</TT>.</P><P>In script mode, the first line of the script is ignored if it starts
181
103
with <TT>#!</TT>. Thus, it should be possible to make the script
182
104
itself executable and put as first line <TT>#!/usr/local/bin/ocaml</TT>,
183
105
thus calling the toplevel system automatically when the script is
185
107
of Objective Caml, and Unix kernels usually do not handle nested <TT>#!</TT>
186
108
scripts. A better solution is to put the following as the first line
187
109
of the script:
188
 
<PRE CLASS="verbatim">
189
 
        #!/usr/local/bin/ocamlrun /usr/local/bin/ocaml
190
 
</PRE></BLOCKQUOTE>
191
 
 
192
 
&nbsp;&nbsp;<FONT COLOR=purple>Windows:</FONT>
193
 
<BLOCKQUOTE CLASS="quote">
 
110
</P><PRE CLASS="verbatim">        #!/usr/local/bin/ocamlrun /usr/local/bin/ocaml
 
111
</PRE></BLOCKQUOTE><BLOCKQUOTE CLASS="quote"><FONT COLOR=purple>Windows:</FONT>��
194
112
In addition to the text-only command <TT>ocaml.exe</TT>, which works exactly
195
113
as under Unix (see above), a graphical user interface for the
196
114
toplevel is available under the name <TT>ocamlwin.exe</TT>. It should be
197
115
launched from the Windows file manager or program manager.
198
116
This interface provides a text window in which commands can be entered
199
117
and edited, and the toplevel responses are printed.
200
 
</BLOCKQUOTE>
201
 
 
202
 
<H2 CLASS="section"><A NAME="htoc109">9.1</A>&nbsp;&nbsp;Options</H2> <A NAME="s:toplevel-options"></A>
203
 
The following command-line options are recognized by the <TT>ocaml</TT> command.
204
 
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B><TT>-I</TT> <I>directory</I></B><DD CLASS="dd-description">
 
118
</BLOCKQUOTE><H2 CLASS="section"><A NAME="htoc109">9.1</A>��Options</H2><P> <A NAME="s:toplevel-options"></A></P><P>The following command-line options are recognized by the <TT>ocaml</TT> command.</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>-I</TT> <I>directory</I></B></DT><DD CLASS="dd-description">
205
119
Add the given directory to the list of directories searched for
206
120
source and compiled files. By default, the current directory is
207
121
searched first, then the standard library directory. Directories added
208
122
with <TT>-I</TT> are searched after the current directory, in the order in
209
123
which they were given on the command line, but before the standard
210
 
library directory.<BR>
211
 
<BR>
212
 
If the given directory starts with <TT>+</TT>, it is taken relative to the
 
124
library directory.<P>If the given directory starts with <TT>+</TT>, it is taken relative to the
213
125
standard library directory. For instance, <TT>-I +labltk</TT> adds the
214
 
subdirectory <TT>labltk</TT> of the standard library to the search path.<BR>
215
 
<BR>
216
 
Directories can also be added to the search path once
 
126
subdirectory <TT>labltk</TT> of the standard library to the search path.</P><P>Directories can also be added to the search path once
217
127
the toplevel is running with the <TT>#directory</TT> directive
218
 
(section&nbsp;<A HREF="#s:toplevel-directives">9.2</A>).<BR>
219
 
<BR>
220
 
<DT CLASS="dt-description"><TT><B>-nolabels</B></TT><DD CLASS="dd-description">
 
128
(section�<A HREF="#s:toplevel-directives">9.2</A>).</P></DD><DT CLASS="dt-description"><TT><B>-nolabels</B></TT></DT><DD CLASS="dd-description">
221
129
Ignore non-optional labels in types. Labels cannot be used in
222
 
applications, and parameter order becomes strict.<BR>
223
 
<BR>
224
 
<DT CLASS="dt-description"><TT><B>-principal</B></TT><DD CLASS="dd-description">
 
130
applications, and parameter order becomes strict.</DD><DT CLASS="dt-description"><TT><B>-principal</B></TT></DT><DD CLASS="dd-description">
225
131
Check information path during type-checking, to make sure that all
226
132
types are derived in a principal way. All programs accepted in
227
133
<TT>-principal</TT> mode are also accepted in default mode with equivalent
228
 
types.<BR>
229
 
<BR>
230
 
<DT CLASS="dt-description"><TT><B>-rectypes</B></TT><DD CLASS="dd-description">
 
134
types.</DD><DT CLASS="dt-description"><TT><B>-rectypes</B></TT></DT><DD CLASS="dd-description">
231
135
Allow arbitrary recursive types during type-checking. By default,
232
136
only recursive types where the recursion goes through an object type
233
 
are supported.<BR>
234
 
<BR>
235
 
<DT CLASS="dt-description"><TT><B>-unsafe</B></TT><DD CLASS="dd-description">
236
 
See the corresponding option for <TT>ocamlc</TT>, chapter&nbsp;<A HREF="manual022.html#c:camlc">8</A>.
 
137
are supported.</DD><DT CLASS="dt-description"><TT><B>-unsafe</B></TT></DT><DD CLASS="dd-description">
 
138
See the corresponding option for <TT>ocamlc</TT>, chapter�<A HREF="manual022.html#c:camlc">8</A>.
237
139
Turn bound checking off on array and string accesses (the <TT>v.(i)</TT> and
238
140
<TT>s.[i]</TT> constructs). Programs compiled with <TT>-unsafe</TT> are therefore
239
141
slightly faster, but unsafe: anything can happen if the program
240
 
accesses an array or string outside of its bounds.<BR>
241
 
<BR>
242
 
<DT CLASS="dt-description" style="background-color:yellow; color:red">
243
 
<TT><B>-version</B></TT><DD CLASS="dd-description" style="background-color:yellow; color:red">
244
 
Print version and exit.<BR>
245
 
<BR>
246
 
<DT CLASS="dt-description"><B><TT>-w</TT> <I>warning-list</I></B><DD CLASS="dd-description">
247
 
Enable or disable warnings according to the argument <I>warning-list</I>.</DL>
248
 
 
249
 
&nbsp;&nbsp;<FONT COLOR=purple>Unix:</FONT>
250
 
<BLOCKQUOTE CLASS="quote">
 
142
accesses an array or string outside of its bounds.</DD><DT CLASS="dt-description"><TT><B>-version</B></TT></DT><DD CLASS="dd-description">
 
143
Print version and exit.</DD><DT CLASS="dt-description"><B><TT>-w</TT> <I>warning-list</I></B></DT><DD CLASS="dd-description">
 
144
Enable or disable warnings according to the argument <I>warning-list</I>.</DD></DL><BLOCKQUOTE CLASS="quote"><FONT COLOR=purple>Unix:</FONT>��
251
145
The following environment variables are also consulted:
252
 
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
253
 
<TT><B>LC_CTYPE</B></TT><DD CLASS="dd-description"> If set to <TT>iso_8859_1</TT>, accented characters (from the
 
146
<DL CLASS="description"><DT CLASS="dt-description">
 
147
<B><TT>LC_CTYPE</TT></B></DT><DD CLASS="dd-description"> If set to <TT>iso_8859_1</TT>, accented characters (from the
254
148
ISO Latin-1 character set) in string and character literals are
255
149
printed as is; otherwise, they are printed as decimal escape sequences
256
 
(<TT>\</TT><I>ddd</I>).<BR>
257
 
<BR>
258
 
<DT CLASS="dt-description"><TT><B>TERM</B></TT><DD CLASS="dd-description"> When printing error messages, the toplevel system
 
150
(<TT>\</TT><I>ddd</I>).</DD><DT CLASS="dt-description"><TT><B>TERM</B></TT></DT><DD CLASS="dd-description"> When printing error messages, the toplevel system
259
151
attempts to underline visually the location of the error. It
260
152
consults the <TT>TERM</TT> variable to determines the type of output terminal
261
 
and look up its capabilities in the terminal database.<BR>
262
 
<BR>
263
 
<DT CLASS="dt-description"><TT><B>HOME</B></TT><DD CLASS="dd-description"> Directory where the <TT>.ocamlinit</TT> file is searched.
264
 
</DL>
265
 
</BLOCKQUOTE>
266
 
 
267
 
<H2 CLASS="section"><A NAME="htoc110">9.2</A>&nbsp;&nbsp;Toplevel directives</H2>
268
 
<A NAME="s:toplevel-directives"></A>
269
 
The following directives control the toplevel behavior, load files in
270
 
memory, and trace program execution.<BR>
271
 
<BR>
272
 
<B>Note:</B> all directives start with a <TT>#</TT> (sharp) symbol. This <TT>#</TT>
 
153
and look up its capabilities in the terminal database.</DD><DT CLASS="dt-description"><TT><B>HOME</B></TT></DT><DD CLASS="dd-description"> Directory where the <TT>.ocamlinit</TT> file is searched.
 
154
</DD></DL>
 
155
</BLOCKQUOTE><H2 CLASS="section"><A NAME="htoc110">9.2</A>��Toplevel directives</H2><P>
 
156
<A NAME="s:toplevel-directives"></A></P><P>The following directives control the toplevel behavior, load files in
 
157
memory, and trace program execution.</P><P><B>Note:</B> all directives start with a <TT>#</TT> (sharp) symbol. This <TT>#</TT>
273
158
must be typed before the directive, and must not be confused with the
274
159
<TT>#</TT> prompt displayed by the interactive loop. For instance,
275
160
typing <TT>#quit;;</TT> will exit the toplevel loop, but typing <TT>quit;;</TT>
276
 
will result in an &#8220;unbound value <TT>quit</TT>&#8221; error.
277
 
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><TT><B>#quit;;</B></TT><DD CLASS="dd-description">
278
 
Exit the toplevel loop and terminate the <TT>ocaml</TT> command.<BR>
279
 
<BR>
280
 
<DT CLASS="dt-description"><B><TT>#labels </TT><I>bool</I><TT>;;</TT></B><DD CLASS="dd-description">
 
161
will result in an &#X201C;unbound value <TT>quit</TT>&#X201D; error.</P><DL CLASS="description"><DT CLASS="dt-description"><TT><B>#quit;;</B></TT></DT><DD CLASS="dd-description">
 
162
Exit the toplevel loop and terminate the <TT>ocaml</TT> command.</DD><DT CLASS="dt-description"><B><TT>#labels </TT><I>bool</I><TT>;;</TT></B></DT><DD CLASS="dd-description">
281
163
Ignore labels in function types if argument is <TT>false</TT>, or switch back
282
 
to default behaviour (commuting style) if argument is <TT>true</TT>.<BR>
283
 
<BR>
284
 
<DT CLASS="dt-description"><B><TT>#warnings "</TT><I>warning-list</I><TT>";;</TT></B><DD CLASS="dd-description">
285
 
Enable or disable warnings according to the argument.<BR>
286
 
<BR>
287
 
<DT CLASS="dt-description"><B><TT>#directory "</TT><I>dir-name</I><TT>";;</TT></B><DD CLASS="dd-description">
 
164
to default behaviour (commuting style) if argument is <TT>true</TT>.</DD><DT CLASS="dt-description"><B><TT>#warnings "</TT><I>warning-list</I><TT>";;</TT></B></DT><DD CLASS="dd-description">
 
165
Enable or disable warnings according to the argument.</DD><DT CLASS="dt-description"><B><TT>#directory "</TT><I>dir-name</I><TT>";;</TT></B></DT><DD CLASS="dd-description">
288
166
Add the given directory to the list of directories searched for
289
 
source and compiled files.<BR>
290
 
<BR>
291
 
<DT CLASS="dt-description"><B><TT>#cd "</TT><I>dir-name</I><TT>";;</TT></B><DD CLASS="dd-description">
292
 
Change the current working directory.<BR>
293
 
<BR>
294
 
<DT CLASS="dt-description"><B><TT>#load "</TT><I>file-name</I><TT>";;</TT></B><DD CLASS="dd-description">
 
167
source and compiled files.</DD><DT CLASS="dt-description"><B><TT>#cd "</TT><I>dir-name</I><TT>";;</TT></B></DT><DD CLASS="dd-description">
 
168
Change the current working directory.</DD><DT CLASS="dt-description"><B><TT>#load "</TT><I>file-name</I><TT>";;</TT></B></DT><DD CLASS="dd-description">
295
169
Load in memory a bytecode object file (<TT>.cmo</TT> file) produced by
296
 
the batch compiler <TT>ocamlc</TT>.<BR>
297
 
<BR>
298
 
<DT CLASS="dt-description"><B><TT>#use "</TT><I>file-name</I><TT>";;</TT></B><DD CLASS="dd-description">
 
170
the batch compiler <TT>ocamlc</TT>.</DD><DT CLASS="dt-description"><B><TT>#use "</TT><I>file-name</I><TT>";;</TT></B></DT><DD CLASS="dd-description">
299
171
Read, compile and execute source phrases from the given file.
300
172
This is textual inclusion: phrases are processed just as if
301
173
they were typed on standard input. The reading of the file stops at
302
 
the first error encountered.<BR>
303
 
<BR>
304
 
<DT CLASS="dt-description"><B><TT>#install_printer </TT><I>printer-name</I><TT>;;</TT></B><DD CLASS="dd-description">
 
174
the first error encountered.</DD><DT CLASS="dt-description"><B><TT>#install_printer </TT><I>printer-name</I><TT>;;</TT></B></DT><DD CLASS="dd-description">
305
175
This directive registers the function named <I>printer-name</I> (a
306
176
value path) as a printer for values whose types match the argument
307
177
type of the function. That is, the toplevel loop will call
308
 
<I>printer-name</I> when it has such a value to print.<BR>
309
 
<BR>
310
 
The printing function <I>printer-name</I> should have type
311
 
<FONT COLOR=blue><TT>Format.formatter</TT> <TT>-&gt;</TT> <FONT COLOR=maroon><TT><I>t</I></TT></FONT> <TT>-&gt;</TT> <TT>unit</TT></FONT>, where <I>t</I> is the
 
178
<I>printer-name</I> when it has such a value to print.<P>The printing function <I>printer-name</I> should have type
 
179
<FONT COLOR=blue><TT>Format.formatter</TT> <TT>-&gt;</TT> <FONT COLOR=maroon><I>t</I></FONT> <TT>-&gt;</TT> <TT>unit</TT></FONT>, where <FONT COLOR=maroon><I>t</I></FONT> is the
312
180
type for the values to be printed, and should output its textual
313
 
representation for the value of type <I>t</I> on the given formatter,
 
181
representation for the value of type <FONT COLOR=maroon><I>t</I></FONT> on the given formatter,
314
182
using the functions provided by the <TT>Format</TT> library. For backward
315
183
compatibility, <I>printer-name</I> can also have type
316
 
<FONT COLOR=maroon><I><TT>t</TT></I></FONT> <FONT COLOR=blue><TT>-&gt;</TT> <TT>unit</TT></FONT> and should then output on the standard
317
 
formatter, but this usage is deprecated.<BR>
318
 
<BR>
319
 
<DT CLASS="dt-description"><B><TT>#remove_printer </TT><I>printer-name</I><TT>;;</TT></B><DD CLASS="dd-description">
320
 
Remove the named function from the table of toplevel printers.<BR>
321
 
<BR>
322
 
<DT CLASS="dt-description"><B><TT>#trace </TT><I>function-name</I><TT>;;</TT></B><DD CLASS="dd-description">
 
184
<FONT COLOR=maroon><I>t</I></FONT> <FONT COLOR=blue><TT>-&gt;</TT> <TT>unit</TT></FONT> and should then output on the standard
 
185
formatter, but this usage is deprecated.</P></DD><DT CLASS="dt-description"><B><TT>#remove_printer </TT><I>printer-name</I><TT>;;</TT></B></DT><DD CLASS="dd-description">
 
186
Remove the named function from the table of toplevel printers.</DD><DT CLASS="dt-description"><B><TT>#trace </TT><I>function-name</I><TT>;;</TT></B></DT><DD CLASS="dd-description">
323
187
After executing this directive, all calls to the function named
324
 
<I>function-name</I> will be &#8220;traced&#8221;. That is, the argument and the
 
188
<I>function-name</I> will be &#X201C;traced&#X201D;. That is, the argument and the
325
189
result are displayed for each call, as well as the exceptions escaping
326
190
out of the function, raised either by the function itself or by
327
191
another function it calls. If the function is curried, each argument
328
 
is printed as it is passed to the function.<BR>
329
 
<BR>
330
 
<DT CLASS="dt-description"><B><TT>#untrace </TT><I>function-name</I><TT>;;</TT></B><DD CLASS="dd-description">
331
 
Stop tracing the given function.<BR>
332
 
<BR>
333
 
<DT CLASS="dt-description"><TT><B>#untrace_all;;</B></TT><DD CLASS="dd-description">
334
 
Stop tracing all functions traced so far.<BR>
335
 
<BR>
336
 
<DT CLASS="dt-description"><B><TT>#print_depth </TT><I>n</I><TT>;;</TT></B><DD CLASS="dd-description">
 
192
is printed as it is passed to the function.</DD><DT CLASS="dt-description"><B><TT>#untrace </TT><I>function-name</I><TT>;;</TT></B></DT><DD CLASS="dd-description">
 
193
Stop tracing the given function.</DD><DT CLASS="dt-description"><B><TT>#untrace_all;;</TT></B></DT><DD CLASS="dd-description">
 
194
Stop tracing all functions traced so far.</DD><DT CLASS="dt-description"><B><TT>#print_depth </TT><I>n</I><TT>;;</TT></B></DT><DD CLASS="dd-description">
337
195
Limit the printing of values to a maximal depth of <I>n</I>.
338
196
The parts of values whose depth exceeds <I>n</I> are printed as <TT>...</TT>
339
 
(ellipsis).<BR>
340
 
<BR>
341
 
<DT CLASS="dt-description"><B><TT>#print_length </TT><I>n</I><TT>;;</TT></B><DD CLASS="dd-description">
 
197
(ellipsis).</DD><DT CLASS="dt-description"><B><TT>#print_length </TT><I>n</I><TT>;;</TT></B></DT><DD CLASS="dd-description">
342
198
Limit the number of value nodes printed to at most <I>n</I>.
343
 
Remaining parts of values are printed as <TT>...</TT> (ellipsis).</DL>
344
 
 
345
 
<H2 CLASS="section"><A NAME="htoc111">9.3</A>&nbsp;&nbsp;The toplevel and the module system</H2> <A NAME="s:toplevel-modules"></A>
346
 
Toplevel phrases can refer to identifiers defined in compilation units
 
199
Remaining parts of values are printed as <TT>...</TT> (ellipsis).</DD></DL><H2 CLASS="section"><A NAME="htoc111">9.3</A>��The toplevel and the module system</H2><P> <A NAME="s:toplevel-modules"></A></P><P>Toplevel phrases can refer to identifiers defined in compilation units
347
200
with the same mechanisms as for separately compiled units: either by
348
201
using qualified names (<TT>Modulename.localname</TT>), or by using
349
 
the <TT>open</TT> construct and unqualified names (see section&nbsp;<A HREF="manual011.html#s:names">6.3</A>).<BR>
350
 
<BR>
351
 
However, before referencing another compilation unit, an
 
202
the <TT>open</TT> construct and unqualified names (see section�<A HREF="manual011.html#s:names">6.3</A>).</P><P>However, before referencing another compilation unit, an
352
203
implementation of that unit must be present in memory.
353
204
At start-up, the toplevel system contains implementations for all the
354
205
modules in the the standard library. Implementations for user modules
355
206
can be entered with the <TT>#load</TT> directive described above. Referencing
356
207
a unit for which no implementation has been provided
357
 
results in the error &#8220;Reference to undefined global `...'&nbsp;&#8221;.<BR>
358
 
<BR>
359
 
Note that entering <TT>open </TT><I>Mod</I> merely accesses the compiled
 
208
results in the error &#X201C;Reference to undefined global `&#X2026;'�&#X201D;.</P><P>Note that entering <TT>open </TT><I>Mod</I> merely accesses the compiled
360
209
interface (<TT>.cmi</TT> file) for <I>Mod</I>, but does not load the
361
210
implementation of <I>Mod</I>, and does not cause any error if no
362
211
implementation of <I>Mod</I> has been loaded. The error 
363
 
&#8220;reference to undefined global <I>Mod</I>&#8221; will occur only when
364
 
executing a value or module definition that refers to <I>Mod</I>.<BR>
365
 
<BR>
366
 
 
367
 
<H2 CLASS="section"><A NAME="htoc112">9.4</A>&nbsp;&nbsp;Common errors</H2>
368
 
This section describes and explains the most frequently encountered
369
 
error messages.
370
 
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Cannot find file <I>filename</I></B><DD CLASS="dd-description">
 
212
&#X201C;reference to undefined global <I>Mod</I>&#X201D; will occur only when
 
213
executing a value or module definition that refers to <I>Mod</I>.</P><H2 CLASS="section"><A NAME="htoc112">9.4</A>��Common errors</H2><P>This section describes and explains the most frequently encountered
 
214
error messages.</P><DL CLASS="description"><DT CLASS="dt-description"><B>Cannot find file <I>filename</I></B></DT><DD CLASS="dd-description">
371
215
The named file could not be found in the current directory, nor in the
372
 
directories of the search path. <BR>
373
 
<BR>
374
 
If <I>filename</I> has the format <I>mod</I><TT>.cmi</TT>, this
 
216
directories of the search path. <P>If <I>filename</I> has the format <I>mod</I><TT>.cmi</TT>, this
375
217
means you have referenced the compilation unit <I>mod</I>, but its
376
218
compiled interface could not be found. Fix: compile <I>mod</I><TT>.mli</TT> or
377
 
<I>mod</I><TT>.ml</TT> first, to create the compiled interface <I>mod</I><TT>.cmi</TT>.<BR>
378
 
<BR>
379
 
If <I>filename</I> has the format <I>mod</I><TT>.cmo</TT>, this
 
219
<I>mod</I><TT>.ml</TT> first, to create the compiled interface <I>mod</I><TT>.cmi</TT>.</P><P>If <I>filename</I> has the format <I>mod</I><TT>.cmo</TT>, this
380
220
means you are trying to load with <TT>#load</TT> a bytecode object file that
381
 
does not exist yet. Fix: compile <I>mod</I><TT>.ml</TT> first.<BR>
382
 
<BR>
383
 
If your program spans several directories, this error can also appear
 
221
does not exist yet. Fix: compile <I>mod</I><TT>.ml</TT> first.</P><P>If your program spans several directories, this error can also appear
384
222
because you haven't specified the directories to look into. Fix: use
385
223
the <TT>#directory</TT> directive to add the correct directories to the
386
 
search path.<BR>
387
 
<BR>
388
 
<DT CLASS="dt-description"><B>This expression has type <I>t</I><SUB>1</SUB>, but is used with type <I>t</I><SUB>2</SUB></B><DD CLASS="dd-description">
389
 
See section&nbsp;<A HREF="manual022.html#s:comp-errors">8.4</A>.<BR>
390
 
<BR>
391
 
<DT CLASS="dt-description"><B>Reference to undefined global <I>mod</I></B><DD CLASS="dd-description">
 
224
search path.</P></DD><DT CLASS="dt-description"><B>This expression has type <I>t</I><SUB>1</SUB>, but is used with type <I>t</I><SUB>2</SUB></B></DT><DD CLASS="dd-description">
 
225
See section�<A HREF="manual022.html#s:comp-errors">8.4</A>.</DD><DT CLASS="dt-description"><B>Reference to undefined global <I>mod</I></B></DT><DD CLASS="dd-description">
392
226
You have neglected to load in memory an implementation for a module
393
 
with <TT>#load</TT>. See section&nbsp;<A HREF="#s:toplevel-modules">9.3</A> above.</DL>
394
 
 
395
 
<H2 CLASS="section"><A NAME="htoc113">9.5</A>&nbsp;&nbsp;Building custom toplevel systems: <TT>ocamlmktop</TT></H2>
396
 
The <TT>ocamlmktop</TT> command builds Objective Caml toplevels that
397
 
contain user code preloaded at start-up. <BR>
398
 
<BR>
399
 
The <TT>ocamlmktop</TT> command takes as argument a set of <TT>.cmo</TT> and <TT>.cma</TT>
 
227
with <TT>#load</TT>. See section�<A HREF="#s:toplevel-modules">9.3</A> above.</DD></DL><H2 CLASS="section"><A NAME="htoc113">9.5</A>��Building custom toplevel systems: <TT>ocamlmktop</TT></H2><P>The <TT>ocamlmktop</TT> command builds Objective Caml toplevels that
 
228
contain user code preloaded at start-up. </P><P>The <TT>ocamlmktop</TT> command takes as argument a set of <TT>.cmo</TT> and <TT>.cma</TT>
400
229
files, and links them with the object files that implement the Objective Caml toplevel. The typical use is:
401
 
<PRE CLASS="verbatim">
402
 
        ocamlmktop -o mytoplevel foo.cmo bar.cmo gee.cmo
403
 
</PRE>This creates the bytecode file <TT>mytoplevel</TT>, containing the Objective Caml toplevel system, plus the code from the three <TT>.cmo</TT>
 
230
</P><PRE CLASS="verbatim">        ocamlmktop -o mytoplevel foo.cmo bar.cmo gee.cmo
 
231
</PRE><P>This creates the bytecode file <TT>mytoplevel</TT>, containing the Objective Caml toplevel system, plus the code from the three <TT>.cmo</TT>
404
232
files. This toplevel is directly executable and is started by:
405
 
<PRE CLASS="verbatim">
406
 
        ./mytoplevel
407
 
</PRE>This enters a regular toplevel loop, except that the code from
 
233
</P><PRE CLASS="verbatim">        ./mytoplevel
 
234
</PRE><P>This enters a regular toplevel loop, except that the code from
408
235
<TT>foo.cmo</TT>, <TT>bar.cmo</TT> and <TT>gee.cmo</TT> is already loaded in memory, just as
409
236
if you had typed:
410
 
<PRE CLASS="verbatim">
411
 
        #load "foo.cmo";;
 
237
</P><PRE CLASS="verbatim">        #load "foo.cmo";;
412
238
        #load "bar.cmo";;
413
239
        #load "gee.cmo";;
414
 
</PRE>on entrance to the toplevel. The modules <TT>Foo</TT>, <TT>Bar</TT> and <TT>Gee</TT> are
 
240
</PRE><P>on entrance to the toplevel. The modules <TT>Foo</TT>, <TT>Bar</TT> and <TT>Gee</TT> are
415
241
not opened, though; you still have to do
416
 
<PRE CLASS="verbatim">
417
 
        open Foo;;
418
 
</PRE>yourself, if this is what you wish.<BR>
419
 
<BR>
420
 
 
421
 
<H2 CLASS="section"><A NAME="htoc114">9.6</A>&nbsp;&nbsp;Options</H2>
422
 
The following command-line options are recognized by <TT>ocamlmktop</TT>.
423
 
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B><TT>-cclib</TT> <I>libname</I></B><DD CLASS="dd-description">
 
242
</P><PRE CLASS="verbatim">        open Foo;;
 
243
</PRE><P>yourself, if this is what you wish.</P><H2 CLASS="section"><A NAME="htoc114">9.6</A>��Options</H2><P>The following command-line options are recognized by <TT>ocamlmktop</TT>.</P><DL CLASS="description"><DT CLASS="dt-description"><B><TT>-cclib</TT> <I>libname</I></B></DT><DD CLASS="dd-description">
424
244
Pass the <TT>-l</TT><I>libname</I> option to the C linker when linking in
425
 
&#8220;custom runtime&#8221; mode. See the corresponding option for
426
 
<TT>ocamlc</TT>, in chapter&nbsp;<A HREF="manual022.html#c:camlc">8</A>.<BR>
427
 
<BR>
428
 
<DT CLASS="dt-description"><B><TT>-ccopt</TT> <I>option</I></B><DD CLASS="dd-description">
 
245
&#X201C;custom runtime&#X201D; mode. See the corresponding option for
 
246
<TT>ocamlc</TT>, in chapter�<A HREF="manual022.html#c:camlc">8</A>.</DD><DT CLASS="dt-description"><B><TT>-ccopt</TT> <I>option</I></B></DT><DD CLASS="dd-description">
429
247
Pass the given option to the C compiler and linker, when linking in
430
 
&#8220;custom runtime&#8221; mode. See the corresponding option for
431
 
<TT>ocamlc</TT>, in chapter&nbsp;<A HREF="manual022.html#c:camlc">8</A>.<BR>
432
 
<BR>
433
 
<DT CLASS="dt-description"><TT><B>-custom</B></TT><DD CLASS="dd-description">
434
 
Link in &#8220;custom runtime&#8221; mode. See the corresponding option for
435
 
<TT>ocamlc</TT>, in chapter&nbsp;<A HREF="manual022.html#c:camlc">8</A>.<BR>
436
 
<BR>
437
 
<DT CLASS="dt-description"><B><TT>-I</TT> <I>directory</I></B><DD CLASS="dd-description">
 
248
&#X201C;custom runtime&#X201D; mode. See the corresponding option for
 
249
<TT>ocamlc</TT>, in chapter�<A HREF="manual022.html#c:camlc">8</A>.</DD><DT CLASS="dt-description"><TT><B>-custom</B></TT></DT><DD CLASS="dd-description">
 
250
Link in &#X201C;custom runtime&#X201D; mode. See the corresponding option for
 
251
<TT>ocamlc</TT>, in chapter�<A HREF="manual022.html#c:camlc">8</A>.</DD><DT CLASS="dt-description"><B><TT>-I</TT> <I>directory</I></B></DT><DD CLASS="dd-description">
438
252
Add the given directory to the list of directories searched for
439
 
compiled object code files (<TT>.cmo</TT> and <TT>.cma</TT>).<BR>
440
 
<BR>
441
 
<DT CLASS="dt-description"><B><TT>-o</TT> <I>exec-file</I></B><DD CLASS="dd-description">
 
253
compiled object code files (<TT>.cmo</TT> and <TT>.cma</TT>).</DD><DT CLASS="dt-description"><B><TT>-o</TT> <I>exec-file</I></B></DT><DD CLASS="dd-description">
442
254
Specify the name of the toplevel file produced by the linker.
443
 
The default is <TT>a.out</TT>.</DL>
444
 
 
445
 
 
446
 
 
447
 
<HR>
448
 
<A HREF="manual022.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
449
 
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
450
 
<A HREF="manual024.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
 
255
The default is <TT>a.out</TT>.</DD></DL><HR>
 
256
<A HREF="manual022.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
 
257
<A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
 
258
<A HREF="manual024.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
451
259
</BODY>
452
260
</HTML>