File: manual021.html

package info (click to toggle)
ocaml-doc 2.04-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,820 kB
  • ctags: 997
  • sloc: makefile: 38; sh: 12
file content (420 lines) | stat: -rw-r--r-- 20,135 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset= ISO-8859-1">
<TITLE>
 The toplevel system (ocaml)
</TITLE>
</HEAD>
<BODY >
<A HREF="manual020.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual022.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<HR>

<H1>Chapter&nbsp;8:&nbsp;&nbsp; The toplevel system (ocaml)</H1> <A NAME="c:camllight"></A>
This chapter describes the toplevel system for Objective Caml, that permits interactive use of the Objective Caml system
through a read-eval-print loop. In this mode, the system repeatedly
reads Caml phrases from the input, then typechecks, compile and
evaluate them, then prints the inferred type and result value, if
any. The system prints a <TT>#</TT> (sharp) prompt before reading each
phrase.<BR>
<BR>
Input to the toplevel can span several lines. It is terminated by <TT>;;</TT> (a
double-semicolon). The toplevel input consists in one or several
toplevel phrases, with the following syntax:<BR>
<BR>
<DIV ALIGN=center>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD  ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>toplevel-input</FONT></I></TT></TD>
<TD  ALIGN=right NOWRAP>::=</TD>
<TD  ALIGN=left NOWRAP>
 { <TT><I><FONT COLOR=maroon>toplevel-phrase</FONT></I></TT> } <TT><FONT COLOR=blue>;;</FONT></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>toplevel-phrase</FONT></I></TT></TD>
<TD  ALIGN=right NOWRAP>::=</TD>
<TD  ALIGN=left NOWRAP>
 <TT><I><FONT COLOR=maroon>definition</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><I><FONT COLOR=maroon>expr</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><FONT COLOR=blue>#</FONT></TT> <TT><I><FONT COLOR=maroon>ident</FONT></I></TT> &nbsp;<TT><I><FONT COLOR=maroon>directive-argument</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>definition</FONT></I></TT></TD>
<TD  ALIGN=right NOWRAP>::=</TD>
<TD  ALIGN=left NOWRAP>
 <TT><FONT COLOR=blue>let</FONT></TT> [<TT><FONT COLOR=blue>rec</FONT></TT>] <TT><I><FONT COLOR=maroon>let-binding</FONT></I></TT> &nbsp;{ <TT><FONT COLOR=blue>and</FONT></TT> <TT><I><FONT COLOR=maroon>let-binding</FONT></I></TT> }</TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><FONT COLOR=blue>external</FONT></TT> <TT><I><FONT COLOR=maroon>value-name</FONT></I></TT> <TT><FONT COLOR=blue>:</FONT></TT> &nbsp;<TT><I><FONT COLOR=maroon>typexpr</FONT></I></TT> <TT><FONT COLOR=blue>=</FONT></TT> &nbsp;<TT><I><FONT COLOR=maroon>external-declaration</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><I><FONT COLOR=maroon>type-definition</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><I><FONT COLOR=maroon>exception-definition</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><FONT COLOR=blue>module</FONT></TT> <TT><I><FONT COLOR=maroon>module-name</FONT></I></TT> &nbsp;[ <TT><FONT COLOR=blue>:</FONT></TT> <TT><I><FONT COLOR=maroon>module-type</FONT></I></TT> ] <TT><FONT COLOR=blue>=</FONT></TT> &nbsp;<TT><I><FONT COLOR=maroon>module-expr</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><FONT COLOR=blue>module</FONT></TT> <TT><FONT COLOR=blue>type</FONT></TT> <TT><I><FONT COLOR=maroon>modtype-name</FONT></I></TT> <TT><FONT COLOR=blue>=</FONT></TT> &nbsp;<TT><I><FONT COLOR=maroon>module-type</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><FONT COLOR=blue>open</FONT></TT> <TT><I><FONT COLOR=maroon>module-path</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>directive-argument</FONT></I></TT></TD>
<TD  ALIGN=right NOWRAP>::=</TD>
<TD  ALIGN=left NOWRAP>
 <TT><I><FONT COLOR=maroon>nothing</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><I><FONT COLOR=maroon>string-literal</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><I><FONT COLOR=maroon>integer-literal</FONT></I></TT></TD>
</TR>
<TR><TD  ALIGN=right NOWRAP>&nbsp;</TD>
<TD  ALIGN=right NOWRAP>|</TD>
<TD  ALIGN=left NOWRAP> <TT><I><FONT COLOR=maroon>value-path</FONT></I></TT></TD>
</TR></TABLE></DIV><BR>
A phrase can consist of a definition, similar to those found in
implementations of compilation units or in <TT><FONT COLOR=blue>struct</FONT></TT> ... <TT><FONT COLOR=blue>end</FONT></TT>
module expressions. The definition can bind value names, type names,
an exception, a module name, or a module type name. The toplevel
system performs the bindings, then prints the types and values (if
any) for the names thus defined.<BR>
<BR>
A phrase may also consist in a <TT>open</TT> directive (see
section&nbsp;<A HREF="manual017.html#s:module-expr">5.11</A>), or a value expression
(section&nbsp;<A HREF="manual013.html#s:value-expr">5.7</A>). Expressions are simply evaluated,
without performing any bindings, and the value of the expression is
printed.<BR>
<BR>
Finally, a phrase can also consist in a toplevel directive,
starting with <TT>#</TT> (the sharp sign). These directives control the
behavior of the toplevel; they are listed below in
section&nbsp;<A HREF="manual021.html#s:toplevel-directives">8.2</A>.<BR>
<BR>

&nbsp;&nbsp;<FONT COLOR=purple>Unix:</FONT>
<BLOCKQUOTE>
The toplevel system is started by the command <TT>ocaml</TT>, as follows:
<PRE>
        ocaml <I>options</I>               # interactive mode
        ocaml <I>options</I> <I>scriptfile</I>        # script mode
</PRE>
If no filename is given on the command line, the toplevel system
enters interactive mode: phrases are read on standard input, results
are printed on standard output, errors on standard error. End-of-file
on standard input terminates <TT>ocaml</TT> (see also the <TT>#quit</TT> directive
in section&nbsp;<A HREF="manual021.html#s:toplevel-directives">8.2</A>).<BR>
<BR>
On start-up (before the first phrase is read), if the file
<TT>.ocamlinit</TT> exists in the current directory,
its contents are read as a sequence of Objective Caml phrases
and executed as per the <TT>#use</TT> directive
described in section&nbsp;<A HREF="manual021.html#s:toplevel-directives">8.2</A>.
The evaluation outcode for each phrase are not displayed.<BR>
<BR>
The toplevel system does not perform line editing, but it can
easily be used in conjunction with an external line editor such as
<TT>fep</TT>; just run <TT>fep -emacs ocaml</TT> or <TT>fep -vi ocaml</TT>.
Another option is to use <TT>ocaml</TT> under Gnu Emacs, which gives the
full editing power of Emacs (see the subdirectory <TT>emacs</TT> of the
Objective Caml distribution).<BR>
<BR>
At any point, the parsing, compilation or evaluation of the current
phrase can be interrupted by pressing <TT>ctrl-C</TT> (or, more precisely,
by sending the <TT>sigintr</TT> signal to the <TT>ocaml</TT> process). The toplevel
then immediately returns to the <TT>#</TT> prompt.<BR>
<BR>
If a filename is given on the command-line to <TT>ocaml</TT>, the toplevel
system enters script mode: the contents of the file are read as a
sequence of Objective Caml phrases and executed, as per the <TT>#use</TT>
directive (section&nbsp;<A HREF="manual021.html#s:toplevel-directives">8.2</A>). The outcome of the
evaluation is not printed. On reaching the end of file, the <TT>ocaml</TT>
command exits immediately. No commands are read from standard input.<BR>
<BR>
In script mode, the first line of the script is ignored if it starts
with <TT>#!</TT>. Thus, it is theoretically possible to make the script
itself executable and put as first line <TT>#!/usr/local/bin/ocaml</TT>,
thus calling the toplevel system automatically when the script is
run. However, <TT>ocaml</TT> itself is a <TT>#!</TT> script on most installations
of Objective Caml, and Unix kernels usually do not handle nested <TT>#!</TT>
scripts.</BLOCKQUOTE><BR>
<BR>

&nbsp;&nbsp;<FONT COLOR=purple>Windows:</FONT>
<BLOCKQUOTE>
In addition to the text-only command <TT>ocaml.exe</TT>, which works exactly
as under Unix (see above), a graphical user interface for the
toplevel is available under the name <TT>ocamlwin.exe</TT>. It should be
launched from the Windows file manager or program manager.<BR>
<BR>
The ``Terminal'' windows is split in two panes. Phrases are entered
and edited in the bottom pane. The top pane displays a copy of the
input phrases as they are processed by the Caml Light toplevel,
interspersed with the toplevel responses. The ``Return'' key sends the
contents of the bottom pane to the Caml Light toplevel. The ``Enter''
key inserts a newline without sending the contents of the Input
window. (This can be configured with the ``Preferences'' menu item.)<BR>
<BR>
The contents of the input window can be edited at all times, with the
standard Windows interface. An history of previously entered phrases
is maintained and displayed in a separate window.<BR>
<BR>
To quit the <TT>Camlwin</TT> application, either select ``Quit'' from
the ``File'' menu, or use the <TT>quit</TT> function described below.<BR>
<BR>
At any point, the parsing, compilation or evaluation of the current
phrase can be interrupted by selecting the ``Interrupt Caml Light''
menu item. This goes back to the <TT>#</TT> prompt.
</BLOCKQUOTE>
<H2>8.1&nbsp;&nbsp; Options</H2> <A NAME="s:toplevel-options"></A>The following command-line options are recognized by the <TT>ocaml</TT> command.<BR>
<BR>
<DL COMPACT=compact>
<DT><TT>-I</TT> <I>directory</I><DD>
Add the given directory to the list of directories searched for
source and compiled files. By default, the current directory is
searched first, then the standard library directory. Directories added
with <TT>-I</TT> are searched after the current directory, in the order in
which they were given on the command line, but before the standard
library directory.<BR>
<BR>
Directories can also be added to the search path once
the toplevel is running with the <TT>#directory</TT> directive
(section&nbsp;<A HREF="manual021.html#s:toplevel-directives">8.2</A>).<BR>
<BR>

<DT><TT>-rectypes</TT><DD>
Allow arbitrary recursive types during type-checking. By default,
only recursive types where the recursion goes through an object type
are supported.<BR>
<BR>

<DT><TT>-unsafe</TT><DD>
See the corresponding option for <TT>ocamlc</TT>, chapter&nbsp;<A HREF="manual020.html#c:camlc">7</A>.
Turn bound checking off on array and string accesses (the <TT>v.(i)</TT> and
<TT>s.[i]</TT> constructs). Programs compiled with <TT>-unsafe</TT> are therefore
slightly faster, but unsafe: anything can happen if the program
accesses an array or string outside of its bounds.</DL>
&nbsp;&nbsp;<FONT COLOR=purple>Unix:</FONT>
<BLOCKQUOTE>
The following environment variables are also consulted:
<DL COMPACT=compact>
<DT>
<TT>LC</TT><TT>_</TT><TT>CTYPE</TT><DD> If set to <TT>iso</TT><TT>_</TT><TT>8859</TT><TT>_</TT><TT>1</TT>, accented characters (from the
ISO Latin-1 character set) in string and character literals are
printed as is; otherwise, they are printed as decimal escape sequences
(<TT>\</TT><I>ddd</I>).<BR>
<BR>

<DT><TT>TERM</TT><DD> When printing error messages, the toplevel system
attempts to underline visually the location of the error. It
consults the <TT>TERM</TT> variable to determines the type of output terminal
and look up its capabilities in the terminal database.
</DL>
</BLOCKQUOTE>
<H2>8.2&nbsp;&nbsp; Toplevel directives</H2>
<A NAME="s:toplevel-directives"></A>The following directives control the toplevel behavior, load files in
memory, and trace program execution.<BR>
<BR>
<DL COMPACT=compact>
<DT><TT>#quit;;</TT><DD>
Exit the toplevel loop and terminate the <TT>ocaml</TT> command.<BR>
<BR>

<DT><TT>#directory "</TT><I>dir-name</I><TT>";;</TT><DD>
Add the given directory to the list of directories searched for
source and compiled files.<BR>
<BR>

<DT><TT>#cd "</TT><I>dir-name</I><TT>";;</TT><DD>
Change the current working directory.<BR>
<BR>

<DT><TT>#load "</TT><I>file-name</I><TT>";;</TT><DD>
Load in memory a bytecode object file (<TT>.cmo</TT> file) produced by
the batch compiler <TT>ocamlc</TT>.<BR>
<BR>

<DT><TT>#use "</TT><I>file-name</I><TT>";;</TT><DD>
Read, compile and execute source phrases from the given file.
This is textual inclusion: phrases are processed just as if
they were typed on standard input. The reading of the file stops at
the first error encountered.<BR>
<BR>

<DT><TT>#install</TT><TT>_</TT><TT>printer </TT><I>printer-name</I><TT>;;</TT><DD>
This directive registers the function named <I>printer-name</I> (a
value path) as a printer for objects whose types match the argument
type of the function. That is, the toplevel loop will call
<I>printer-name</I> when it has such an object to print.
The printing function <I>printer-name</I> must use the <TT>Format</TT> library
module to produce its output, otherwise its output will not be
correctly located in the values printed by the toplevel loop.<BR>
<BR>

<DT><TT>#remove</TT><TT>_</TT><TT>printer </TT><I>printer-name</I><TT>;;</TT><DD>
Remove the named function from the table of toplevel printers.<BR>
<BR>

<DT><TT>#trace </TT><I>function-name</I><TT>;;</TT><DD>
After executing this directive, all calls to the function named
<I>function-name</I> will be ``traced''. That is, the argument and the
result are displayed for each call, as well as the exceptions escaping
out of the function, raised either by the function itself or by
another function it calls. If the function is curried, each argument
is printed as it is passed to the function.<BR>
<BR>

<DT><TT>#untrace </TT><I>function-name</I><TT>;;</TT><DD>
Stop tracing the given function.<BR>
<BR>

<DT><TT>#untrace</TT><TT>_</TT><TT>all;;</TT><DD>
Stop tracing all functions traced so far.<BR>
<BR>

<DT><TT>#print</TT><TT>_</TT><TT>depth </TT><I>n</I><TT>;;</TT><DD>
Limit the printing of values to a maximal depth of <I>n</I>.
The parts of values whose depth exceeds <I>n</I> are printed as <TT>...</TT>
(ellipsis).<BR>
<BR>

<DT><TT>#print</TT><TT>_</TT><TT>length </TT><I>n</I><TT>;;</TT><DD>
Limit the number of value nodes printed to at most <I>n</I>.
Remaining parts of values are printed as <TT>...</TT> (ellipsis).</DL>
<H2>8.3&nbsp;&nbsp; The toplevel and the module system</H2> <A NAME="s:toplevel-modules"></A>Toplevel phrases can refer to identifiers defined in compilation units
with the same mechanisms as for separately compiled units: either by
using qualified names (<TT>Modulename.localname</TT>), or by using
the <TT>open</TT> construct and unqualified names (see section&nbsp;<A HREF="manual009.html#s:names">5.3</A>).<BR>
<BR>
However, before referencing another compilation unit, an
implementation of that unit must be present in memory.
At start-up, the toplevel system contains implementations for all the
modules in the the standard library. Implementations for user modules
can be entered with the <TT>#load</TT> directive described above. Referencing
a unit for which no implementation has been provided
results in the error ``Reference to undefined global `...'&nbsp;''.<BR>
<BR>
Note that entering <TT>open </TT><I>mod</I> merely accesses the compiled
interface (<TT>.cmi</TT> file) for <I>mod</I>, but does not load the
implementation of <I>mod</I>, and does not cause any error if no
implementation of <I>mod</I> has been loaded. The error 
``reference to undefined global <I>mod</I>'' will occur only when
executing a value or module definition that refers to <I>mod</I>.<BR>
<BR>

<H2>8.4&nbsp;&nbsp; Common errors</H2>This section describes and explains the most frequently encountered
error messages.<BR>
<BR>
<DL COMPACT=compact>
<DT>Cannot find file <I>filename</I><DD>
The named file could not be found in the current directory, nor in the
directories of the search path. <BR>
<BR>
If <I>filename</I> has the format <I>mod</I><TT>.cmi</TT>, this
means you have referenced the compilation unit <I>mod</I>, but its
compiled interface could not be found. Fix: compile <I>mod</I><TT>.mli</TT> or
<I>mod</I><TT>.ml</TT> first, to create the compiled interface <I>mod</I><TT>.cmi</TT>.<BR>
<BR>
If <I>filename</I> has the format <I>mod</I><TT>.cmo</TT>, this
means you are trying to load with <TT>#load</TT> a bytecode object file that
does not exist yet. Fix: compile <I>mod</I><TT>.ml</TT> first.<BR>
<BR>
If your program spans several directories, this error can also appear
because you haven't specified the directories to look into. Fix: use
the <TT>#directory</TT> directive to add the correct directories to the
search path.<BR>
<BR>

<DT>This expression has type <I>t</I><SUB><FONT SIZE=2>1</FONT></SUB>, but is used with type <I>t</I><SUB><FONT SIZE=2>2</FONT></SUB><DD>
See section&nbsp;<A HREF="manual020.html#s:comp-errors">7.4</A>.<BR>
<BR>

<DT>Reference to undefined global <I>mod</I><DD>
You have neglected to load in memory an implementation for a module
with <TT>#load</TT>. See section&nbsp;<A HREF="manual021.html#s:toplevel-modules">8.3</A> above.</DL>
<H2>8.5&nbsp;&nbsp; Building custom toplevel systems: <TT>ocamlmktop</TT></H2>The <TT>ocamlmktop</TT> command builds Objective Caml toplevels that
contain user code preloaded at start-up. <BR>
<BR>
The <TT>ocamlmktop</TT> command takes as argument a set of <TT>.cmo</TT> and <TT>.cma</TT>
files, and links them with the object files that implement the Objective Caml toplevel. The typical use is:
<PRE>
        ocamlmktop -o mytoplevel foo.cmo bar.cmo gee.cmo
</PRE>
This creates the bytecode file <TT>mytoplevel</TT>, containing the Objective Caml toplevel system, plus the code from the three <TT>.cmo</TT>
files. This toplevel is directly executable and is started by:
<PRE>
        ./mytoplevel
</PRE>
This enters a regular toplevel loop, except that the code from
<TT>foo.cmo</TT>, <TT>bar.cmo</TT> and <TT>gee.cmo</TT> is already loaded in memory, just as
if you had typed:
<PRE>
        #load "foo.cmo";;
        #load "bar.cmo";;
        #load "gee.cmo";;
</PRE>
on entrance to the toplevel. The modules <TT>Foo</TT>, <TT>Bar</TT> and <TT>Gee</TT> are
not opened, though; you still have to do
<PRE>
        open Foo;;
</PRE>
yourself, if this is what you wish.<BR>
<BR>

<H2>8.6&nbsp;&nbsp; Options</H2>The following command-line options are recognized by <TT>ocamlmktop</TT>.<BR>
<BR>
<DL COMPACT=compact>
<DT><TT>-cclib</TT> <I>libname</I><DD>
Pass the <TT>-l</TT><I>libname</I> option to the C linker when linking in
``custom runtime'' mode. See the corresponding option for
<TT>ocamlc</TT>, in chapter&nbsp;<A HREF="manual020.html#c:camlc">7</A>.<BR>
<BR>

<DT><TT>-ccopt</TT> <I>option</I><DD>
Pass the given option to the C compiler and linker, when linking in
``custom runtime'' mode. See the corresponding option for
<TT>ocamlc</TT>, in chapter&nbsp;<A HREF="manual020.html#c:camlc">7</A>.<BR>
<BR>

<DT><TT>-custom</TT><DD>
Link in ``custom runtime'' mode. See the corresponding option for
<TT>ocamlc</TT>, in chapter&nbsp;<A HREF="manual020.html#c:camlc">7</A>.<BR>
<BR>

<DT><TT>-I</TT> <I>directory</I><DD>
Add the given directory to the list of directories searched for
compiled object code files (<TT>.cmo</TT> and <TT>.cma</TT>).<BR>
<BR>

<DT><TT>-o</TT> <I>exec-file</I><DD>
Specify the name of the toplevel file produced by the linker.
The default is <TT>a.out</TT>.</DL>

<HR>
<A HREF="manual020.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual022.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
</BODY>
</HTML>