Welcome to utop version 2.7.0 (using OCaml version 4.08.1)! utop[0]> 10;; - : int = 10 utop[1]> 10.4;; - : float = 10.4 utop[2]> 's';; - : char = 's' utop[3]> True;; Line 1, characters 0-4: Error: Unbound constructor True Hint: Did you mean true? utop[4]> true;; - : bool = true utop[5]> false;; - : bool = false utop[6]> max(2,3);; - : int * int -> int * int = utop[7]> if 3 = 4 then "d" else "tt";; - : string = "tt" utop[8]> max 4 8;; - : int = 8 utop[9]> max 8 4;; - : int = 8 utop[10]> (3,4);; - : int * int = (3, 4) utop[11]> (3,4,5);; - : int * int * int = (3, 4, 5) utop[12]> let carre x = x * x ;; val carre : int -> int = utop[13]> carre(10);; - : int = 100 utop[14]> carre 10;; - : int = 100 utop[15]> (10);; - : int = 10 utop[16]> carre 10 2;; Line 1, characters 0-5: Error: This function has type int -> int It is applied to too many arguments; maybe you forgot a `;'. utop[17]> carre(1,2);; Line 1, characters 5-10: Error: This expression has type 'a * 'b but an expression was expected of type int utop[18]> carre 10.0;; Line 1, characters 6-10: Error: This expression has type float but an expression was expected of type int utop[19]> 10.0 *. 3.4;; - : float = 34. utop[20]> 10.0 *. float_of_int 3.4;; Line 1, characters 21-24: Error: This expression has type float but an expression was expected of type int utop[21]> 10.0 *. float_of_int 4;; - : float = 40. utop[22]> float_of_int;; - : int -> float = utop[23]> float_of_int 40;; - : float = 40. utop[24]> int_of_float;; - : float -> int = utop[25]> int_of_float 14.3;; - : int = 14 utop[26]> (+);; - : int -> int -> int = utop[27]> (+) 2 4;; - : int = 6 utop[28]> 2 + 4;; - : int = 6 utop[29]> max 30 12 * 2;; - : int = 60 utop[30]> max 30 (12 * 2);; - : int = 30 utop[31]> sqrt (max (cos 3.14) (sin 3.14));; - : float = 0.0399080557843504574 utop[32]> 20.e4;; - : float = 200000. utop[33]> &&;; Error: Syntax error utop[34]> (&&);; - : bool -> bool -> bool = utop[35]> 1 = 3 || 2 = 2;; - : bool = true utop[36]> 1 = 3 && 2 = 2;; - : bool = false utop[37]> 9 <= 10;; - : bool = true utop[38]> 9.0 <= 10.0;; - : bool = true utop[39]> 9.0 <= 10;; Line 1, characters 7-9: Error: This expression has type int but an expression was expected of type float utop[40]> 3 = 4;; - : bool = false utop[41]> 3 == 3;; - : bool = true utop[42]> let a = 10;; val a : int = 10 utop[43]> a;; - : int = 10 utop[44]> let b = 3;; val b : int = 3 utop[45]> if a = 0 then if b = 0 then -1 else 0 else 1;; - : int = 1