ocaml


Hits :

2,839


ocaml.org


some notes on ocaml


facts:


  • ML is a general-purpose functional programming language
  • Caml is a dialect of the ML 
  • OCaml is the most popular variant of the Caml language
  • Caml Light's successor is OCaml
  • OCaml is also known as: Objective Caml

Documentation and userΆs manual



ONE


HTML
ebal@mylaptop ~$ ocaml
        OCaml version 4.00.1

# 1+2*3;;
- : int = 7

# 1;;
- : int = 1
# 1.1;;
- : float = 1.1
# 'a';;
- : char = 'a'
# "a";;
- : string = "a"
# abc;;
Error: Unbound value abc
# "abc";;
- : string = "abc"

# true;;
- : bool = true
# false;;
- : bool = false

# (1<2);;
- : bool = true
# (1>2);;
- : bool = false

# ["hello", "world"];;
- : (string * string) list = [("hello", "world")]

# ["hello"; "world"];;
- : string list = ["hello"; "world"]

# "a" :: ["hello"; "world"];;
- : string list = ["a"; "hello"; "world"]

Two