Welcome to utop version 2.13.1 (using OCaml version 4.13.1)! utop[0]> 1 + 3;; - : int = 4 utop[1]> max 10 34 ;; - : int = 34 utop[2]> [1; 2; 3];; - : int list = [1; 2; 3] utop[3]> 1 :: 2 :: [];; - : int list = [1; 2] utop[4]> 1 = 3;; - : bool = false utop[5]> 1 = 1;; - : bool = true utop[6]> 1;; - : int = 1 utop[7]> 1.1;; - : float = 1.1 utop[8]> "ste";; - : string = "ste" utop[9]> 'a';; - : char = 'a' utop[10]> max;; - : 'a -> 'a -> 'a = utop[11]> fun x -> x +3;; - : int -> int = utop[12]> (fun x -> x +3) 10;; - : int = 13 utop[13]> let f = fun x -> x +3;; val f : int -> int = utop[14]> f 10;; - : int = 13 utop[15]> f;; - : int -> int = utop[16]> 1;; - : int = 1 utop[17]> f 1;; - : int = 4 utop[18]> f (4 + 4);; - : int = 11 utop[19]> max 30 12 * 3;; - : int = 90 utop[20]> max 30 (12 * 3);; - : int = 36 utop[21]> 1 + 4;; - : int = 5 utop[22]> (+);; - : int -> int -> int = utop[23]> (+) 2 3;; - : int = 5 utop[24]> 2 + 3;; - : int = 5 utop[25]> 2.8;; - : float = 2.8 utop[26]> 3.14e-3;; - : float = 0.00314 utop[27]> 3.14e-10;; - : float = 3.14e-10 utop[28]> 1.2 +. 3.4;; - : float = 4.6 utop[29]> 10 mod 3;; - : int = 1 utop[30]> 10 mod 2;; - : int = 0 utop[31]> succ 4;; - : int = 5 utop[32]> pred 4;; - : int = 3 utop[33]> false;; - : bool = false utop[34]> true;; - : bool = true utop[35]> (2 = 2) && (3 = 3);; - : bool = true utop[36]> (2 = 3) && (3 = 3);; - : bool = false utop[37]> (2 = 3) || (3 = 3);; - : bool = true utop[38]> not ((2 = 3) || (3 = 3));; - : bool = false utop[39]> let l1 [1; 2; 3];; Error: Syntax error utop[40]> let l1 = [1; 2; 3];; val l1 : int list = [1; 2; 3] utop[41]> let l2 = [1; 2; 3];; val l2 : int list = [1; 2; 3] utop[42]> l1 = l2;; - : bool = true utop[43]> l1 == l2;; - : bool = false utop[44]> l3 = l1;; Error: Unbound value l3 utop[45]> let l3 = l1;; val l3 : int list = [1; 2; 3] utop[46]> l1 = l3;; - : bool = true utop[47]> l1 == l3;; - : bool = true utop[48]> 6 :: l1;; - : int list = [6; 1; 2; 3] utop[49]> l1;; - : int list = [1; 2; 3] utop[50]> (* gregerge *) ;; utop[51]> if 3 = 4 then "no" else "yes";; - : string = "yes" utop[52]> if 3 = 2 then "no" else "yes";; - : string = "yes" utop[53]> if 3 = 3 then "no" else "yes";; - : string = "no" utop[54]> if 3 = 3 then "no" else 3;; Error: This expression has type int but an expression was expected of type string utop[55]>