From afae1eb5d1dc7633dd5ac8f0e2535c22cd9cfaea Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Fri, 26 Nov 2010 07:33:18 -0500 Subject: [PATCH] tweak calc improvements Signed-off-by: Jim Pryor --- advanced_topics/calculator_improvements.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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). -- 2.11.0