~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to man/ocaml.m

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2009-02-22 08:49:13 UTC
  • mfrom: (12.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222084913-3i0uw2bhd0lgw0ok
* Uploading to unstable
* debian/control: bump dh-ocaml to (>= 0.4) to avoid buggy ocamlinit.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\" $Id: ocaml.m,v 1.10 2008/09/15 14:05:30 doligez Exp $
 
2
 
1
3
.TH OCAML 1
2
4
 
3
5
.SH NAME
4
6
ocaml \- The Objective Caml interactive toplevel
5
7
 
6
 
 
7
8
.SH SYNOPSIS
8
9
.B ocaml
9
10
[
10
 
.B \-unsafe
11
 
]
12
 
[
13
 
.BI \-I \ lib-dir
 
11
.I options
14
12
]
15
13
[
16
14
.I object-files
32
30
A toplevel phrase can span several lines. It is terminated by ;; (a
33
31
double-semicolon). The syntax of toplevel phrases is as follows.
34
32
 
35
 
The toplevel system is started by the command 
 
33
The toplevel system is started by the command
36
34
.BR ocaml (1).
37
35
Phrases are read on standard input, results are printed on standard
38
36
output, errors on standard error. End-of-file on standard input
41
39
 
42
40
If one or more
43
41
.I object-files
44
 
(ending in
45
 
.B .cmo
46
 
or
47
 
.B .cma
48
 
 ) are given, they are loaded silently before starting the toplevel.
 
42
(ending in .cmo or .cma) are given, they are loaded silently before
 
43
starting the toplevel.
49
44
 
50
45
If a
51
46
.I script-file
58
53
 
59
54
The following command-line options are recognized by
60
55
.BR ocaml (1).
61
 
 
62
56
.TP
63
 
.BI \-I \ directory
 
57
.BI -I \ directory
64
58
Add the given directory to the list of directories searched for
65
59
source and compiled files. By default, the current directory is
66
60
searched first, then the standard library directory. Directories added
67
 
with 
 
61
with
68
62
.B \-I
69
63
are searched after the current directory, in the order in which they
70
64
were given on the command line, but before the standard library
71
65
directory.
72
 
 
 
66
.IP
 
67
If the given directory starts with
 
68
.BR + ,
 
69
it is taken relative to the
 
70
standard library directory. For instance,
 
71
.B \-I\ +labltk
 
72
adds the subdirectory
 
73
.B labltk
 
74
of the standard library to the search path.
 
75
.IP
 
76
Directories can also be added to the search path once the toplevel
 
77
is running with the
 
78
.B #directory
 
79
directive.
 
80
.TP
 
81
.BI \-init \ file
 
82
Load the given file instead of the default initialization file.
 
83
The default file is
 
84
.B .ocamlinit
 
85
in the current directory if it exists, otherwise
 
86
.B .ocamlinit
 
87
in the user's home directory.
 
88
.TP
 
89
.B \-labels
 
90
Labels are not ignored in types, labels may be used in applications,
 
91
and labelled parameters can be given in any order.  This is the default.
 
92
.TP
 
93
.B \-noassert
 
94
Do not compile assertion checks.  Note that the special form
 
95
.B assert\ false
 
96
is always compiled because it is typed specially.
 
97
.TP
 
98
.B \-nolabels
 
99
Ignore non-optional labels in types. Labels cannot be used in
 
100
applications, and parameter order becomes strict.
 
101
.TP
 
102
.B \-noprompt
 
103
Do not display any prompt when waiting for input.
 
104
.TP
 
105
.B \-nostdlib
 
106
Do not include the standard library directory in the list of
 
107
directories searched for source and compiled files.
 
108
.TP
 
109
.B \-principal
 
110
Check information path during type-checking, to make sure that all
 
111
types are derived in a principal way.  When using labelled arguments
 
112
and/or polymorphic methods, this flag is required to ensure future
 
113
versions of the compiler will be able to infer types correctly, even
 
114
if internal algorithms change.
 
115
All programs accepted in
 
116
.B \-principal
 
117
mode are also accepted in the
 
118
default mode with equivalent types, but different binary signatures,
 
119
and this may slow down type checking; yet it is a good idea to
 
120
use it once before publishing source code.
 
121
.TP
 
122
.B \-rectypes
 
123
Allow arbitrary recursive types during type-checking.  By default,
 
124
only recursive types where the recursion goes through an object type
 
125
are supported.
73
126
.TP
74
127
.B \-unsafe
75
 
Turn bound checking off on array and string accesses (the v.(i)
76
 
and s.[i] constructs). Programs compiled with 
 
128
Turn bound checking off on array and string accesses (the
 
129
.BR v.(i) and s.[i]
 
130
constructs). Programs compiled with
77
131
.B \-unsafe
78
132
are therefore slightly faster, but unsafe: anything can happen if the program
79
133
accesses an array or string outside of its bounds.
 
134
.TP
 
135
.B \-version
 
136
Print version string and exit.
 
137
.TP
 
138
.BI \-w \ warning-list
 
139
Enable or disable warnings according to the argument
 
140
.IR warning-list .
 
141
See
 
142
.BR ocamlc (1)
 
143
for the syntax of the argument.
 
144
.TP
 
145
.BI \-warn-error \ warning-list
 
146
Treat as errors the warnings enabled by the argument
 
147
.IR warning-list .
 
148
See
 
149
.BR ocamlc (1)
 
150
for the syntax of the argument.
 
151
.TP
 
152
.BR \-help \ or \ \-\-help
 
153
Display a short usage summary and exit.
80
154
 
81
155
.SH ENVIRONMENT VARIABLES
82
 
 
83
156
.TP
84
157
.B LC_CTYPE
85
158
If set to iso_8859_1, accented characters (from the
86
159
ISO Latin-1 character set) in string and character literals are
87
160
printed as is; otherwise, they are printed as decimal escape sequences.
88
 
 
89
161
.TP
90
162
.B TERM
91
163
When printing error messages, the toplevel system
94
166
and look up its capabilities in the terminal database.
95
167
 
96
168
.SH SEE ALSO
97
 
.BR ocamlc (1).
 
169
.BR ocamlc (1), \ ocamlopt (1), \ ocamlrun (1).
98
170
.br
99
 
.I The Objective Caml user's manual,
 
171
.IR The\ Objective\ Caml\ user's\ manual ,
100
172
chapter "The toplevel system".
101