Booleans in OCAML, and simple pattern matching
----------------------------------------------
-Where we would write `true 1 2` and expect it to evaluate to `1`, in
-OCAML boolean types are not functions (equivalently, are functions
-that take zero arguments). Choices are made as follows:
+Where we would write `true 1 2` in our pure lambda calculus and expect
+it to evaluate to `1`, in OCAML boolean types are not functions
+(equivalently, are functions that take zero arguments). Selection is
+accomplished as follows:
# if true then 1 else 2;;
- : int = 1
# match 3 with 1 -> 1 | 2 -> 4 | 3 -> 9;;
- : int = 9
-Unit
-----
+Unit and thunks
+---------------
All functions in OCAML take exactly one argument. Even this one:
# (fun x -> x);;
- : 'a -> 'a = <fun>
# (fun x -> x) true;;
- - : book = true
+ - : bool = true
(But `(fun x -> x x)` still won't work.)
Infinite loop.
-Now consider the following differences:
+Now consider the following variations in behavior:
# let test = omega omega;;
[Infinite loop, need to control c out]