1OCAML(1)                    General Commands Manual                   OCAML(1)
2
3
4

NAME

6       ocaml - The Objective Caml interactive toplevel
7
8
9

SYNOPSIS

11       ocaml [ -unsafe ] [ -I lib-dir ] [ object-files ] [ script-file ]
12

DESCRIPTION

14       The  ocaml(1)  command  is the toplevel system for Objective Caml, that
15       permits interactive use of the Objective Caml system  through  a  read-
16       eval-print loop. In this mode, the system repeatedly reads Caml phrases
17       from the input, then typechecks, compile and evaluate them, then prints
18       the  inferred  type  and  result  value,  if any. The system prints a #
19       (sharp) prompt before reading each phrase.
20
21       A toplevel phrase can span several lines. It is  terminated  by  ;;  (a
22       double-semicolon). The syntax of toplevel phrases is as follows.
23
24       The  toplevel  system  is started by the command ocaml(1).  Phrases are
25       read on standard input, results are printed on standard output,  errors
26       on standard error. End-of-file on standard input terminates ocaml(1).
27
28       If one or more object-files (ending in .cmo or .cma
29        ) are given, they are loaded silently before starting the toplevel.
30
31       If  a  script-file  is  given, phrases are read silently from the file,
32       errors printed on standard error.  ocaml(1) exits after  the  execution
33       of the last phrase.
34
35

OPTIONS

37       The following command-line options are recognized by ocaml(1).
38
39
40       -I directory
41              Add  the given directory to the list of directories searched for
42              source and compiled files. By default, the current directory  is
43              searched first, then the standard library directory. Directories
44              added with -I are searched after the current directory,  in  the
45              order  in  which they were given on the command line, but before
46              the standard library directory.
47
48
49       -unsafe
50              Turn bound checking off on array and string accesses (the  v.(i)
51              and s.[i] constructs). Programs compiled with -unsafe are thereā€
52              fore slightly faster, but unsafe: anything  can  happen  if  the
53              program accesses an array or string outside of its bounds.
54
55

ENVIRONMENT VARIABLES

57       LC_CTYPE
58              If  set to iso_8859_1, accented characters (from the ISO Latin-1
59              character set) in string and character literals are  printed  as
60              is; otherwise, they are printed as decimal escape sequences.
61
62
63       TERM   When  printing  error  messages, the toplevel system attempts to
64              underline visually the location of the error.  It  consults  the
65              TERM variable to determines the type of output terminal and look
66              up its capabilities in the terminal database.
67
68

SEE ALSO

70       ocamlc(1).
71       The Objective Caml user's manual, chapter "The toplevel system".
72
73
74
75
76                                                                      OCAML(1)
Impressum