OCaml/Bases

From Wikibooks, open books for an open world
< OCaml(Redirected from Objective Caml/Bases)
Jump to: navigation, search

Installing OCaml[edit]

Unix[edit]

Most Linux distributions have OCaml in their repositories, it is usually named "ocaml". It's also in the ports of FreeBSD, OpenBSD and NetBSD. You can also download the source from here. See the README and INSTALL files for instructions on how to build OCaml.

Windows[edit]

The most recent Windows binaries for OCaml can be installed from here.

The Toplevel[edit]

After successful installation, open a terminal and execute ocaml. You are now in the Toplevel, an environment for interactively evaluation of Ocaml expressions and definitions, e.g.

3 + 4 ;;
- : int = 7

The ";;" ends an expression.