tweak calc improvements
[lambda.git] / advanced_topics / calculator_improvements.mdwn
index 3e51c95..280604f 100644 (file)
@@ -369,7 +369,7 @@ Our evaluation function will now expect a `store` argument as well as an `assign
        let rec eval (t : term) (g : assignment) (s : store) = match t with
          Intconstant x -> (Int x, s)
          ...
-       | Variable (var) -> (
+       | Variable (var) -> ((
                (* we don't handle cases where g doesn't bind var to any value *)
                match List.assoc var g with
           | Nonrecursive value -> value
@@ -377,7 +377,7 @@ Our evaluation function will now expect a `store` argument as well as an `assign
                          (* we update savedg to bind self_var to rec_closure here *)
               let savedg' = (self_var, rec_closure) :: savedg
               in Closure (arg_var, body, savedg')
-        ), s
+        ), s)
          ...
        | Lambda (arg_var, t2) -> (Closure (arg_var, t2, g), s)
          ...