week11 tweaks
[lambda.git] / coroutines_and_aborts.mdwn
index cd71be4..4c3861f 100644 (file)
@@ -47,7 +47,7 @@ and then having to remember which element in the triple was which:
 records let you attach descriptive labels to the components of the tuple:
 
        # type blah_record = { height : int; weight : int; char_tester : char -> bool };;
-       # let b2 = { height = 1; weight = 2; char_tester = fun c -> c = 'M' };;
+       # let b2 = { height = 1; weight = 2; char_tester = (fun c -> c = 'M') };;
        val b2 : blah_record = {height = 1; weight = 2; char_tester = <fun>}
        # let b3 = { height = 1; char_tester = (fun c -> c = 'K'); weight = 3 };; (* also works *)
        val b3 : blah_record = {height = 1; weight = 3; char_tester = <fun>}
@@ -70,7 +70,7 @@ Here is how you can extract the components of a labeled record:
 
        match test with
        | {height = h; weight = w; char_tester = test} ->
-         (* go on to use h, w, and test ... *)
+         (* same as preceding *)
 
 Anyway, using record types, we might define the tree zipper interface like so:
 
@@ -324,7 +324,7 @@ the effect is for the program to immediately stop. That's not exactly true. You
            ;;
        val foo : int -> int = <fun>
        # foo 1;;
-       - : int = 10
+       - : int = 110
        # foo 2;;
        - : int = 20
        # foo 3;;