X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?a=blobdiff_plain;f=advanced_topics%2Fcalculator_improvements.mdwn;fp=advanced_topics%2Fcalculator_improvements.mdwn;h=541e6958e1c1bb54783f5691e886aa9801c93ce7;hb=afae1eb5d1dc7633dd5ac8f0e2535c22cd9cfaea;hp=720d961a19f97fd7d9184affb373a5df70b4a41b;hpb=060198e29e2a13552ee64c1e489eea555c8b1cae;p=lambda.git diff --git a/advanced_topics/calculator_improvements.mdwn b/advanced_topics/calculator_improvements.mdwn index 720d961a..541e6958 100644 --- a/advanced_topics/calculator_improvements.mdwn +++ b/advanced_topics/calculator_improvements.mdwn @@ -585,7 +585,7 @@ In the present implementation, we separate the roles of the `bound_value` and `e type store = expressed_value list;; -Our evaluation function still interacts with a `store` argument in much the same way it did with explicit-style mutation. The clause for `Variable ...` works differently, because all `expressed_value`s now need to be retrieved from the `store`: +Our evaluation function still interacts with a `store` argument in much the same way it did with explicit-style mutation. The clause for `Variable (...)` works differently, because all `expressed_value`s now need to be retrieved from the `store`: let rec eval (t : term) (g : assignment) (s : store) = match t with ... @@ -655,7 +655,7 @@ Finally, here is the clause for `Change (...)`, which takes over the role earlie in eval t3 g s'' ;; -Note that because the `savedg` component of a `Closure` keeps track of which `index`es in the store free variables were bound to, the values at those `index`es can later be changed, and later applications of the `Closure` will use the changed values. +Note that because the `savedg` component of a `Closure` keeps track of which `index`es in the store---rather than which values---free variables were bound to, the values at those `index`es can later be changed, and later applications of the `Closure` will use the changed values. The complete code is available [here](/code/calculator/calc6.ml).