-With that kind of framework, we can interpret `newref`, `deref`, and `setref` as follows.
+For expressions we already know how to interpret, `s'` will usually just be `s`. One exception is complex expressions like `let var = expr1 in expr2`. Part of interpreting this will be to interpret the sub-expression `expr1`, and we have to allow that in doing that, the store may have already been updated. We want to use that possibly updated store when interpreting `expr2`. Like this:
+
+ let rec eval expression g s =
+ match expression with
+ ...
+ | Let (c, expr1, expr2) ->
+ let (value, s') = eval expr1 g s
+ (* s' may be different from s *)
+ (* now we evaluate expr2 in a new environment where c has been associated
+ with the result of evaluating expr1 in the current environment *)
+ eval expr2 ((c, value) :: g) s'
+ ...
+
+Similarly:
+
+ ...
+ | Addition (expr1, expr2) ->
+ let (value1, s') = eval expr1 g s
+ in let (value2, s'') = eval expr2 g s'
+ in (value1 + value2, s'')
+ ...
+
+Let's consider how to interpet our new syntactic forms `newref`, `deref`, and `setref`:
+