projects
/
lambda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
week9 tweak
[lambda.git]
/
week9.mdwn
diff --git
a/week9.mdwn
b/week9.mdwn
index
7028e89
..
568fc81
100644
(file)
--- a/
week9.mdwn
+++ b/
week9.mdwn
@@
-304,6
+304,15
@@
For expressions we already know how to interpret, `s'` will usually just be `s`.
eval expr2 ((c, value) :: g) s'
...
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`:
Let's consider how to interpet our new syntactic forms `newref`, `deref`, and `setref`: