forked from mwand/eopl3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errata.txt
161 lines (129 loc) · 3.86 KB
/
errata.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Errata: 1st Printing EOPL3
Updated Wed Dec 12 14:44:27 2018
Page 5:
In the deduction tree 2/3 of the way down the page, all the hypotheses that say "xxx in N" should say "xxx in Int",
as described in Definition 1.1.5 (on p. 4)
h/t: Kyle Stansfield (stanfield@ucsb.edu)
Page 44:
Exercise 2.19:
move-to-left => move-to-left-son
move-to-right => move-to-right-son
Page 45:
Exercise 2.19: The definition of t1 is missing a right paren.
Page 45:
Exercise 2.20
at-leaf? is already in exercise 2.19
Page 84:
Exercise 3.32
mututally => mutually
Page 101:
Exercise 3.39
Delete "and 'unpack'"
Page 124:
Section 4.4:
Line 5:
newpair ==> make-pair
Page 180:
205 is printed by the producer. So the text should say:
So the first two items, 300 and 205, are printed by the main thread and the subthread respectively.
Page 195:
Figure 6.1, in apply-cont, the case for fact1-cont:
(begin
(set! cont saved-cont)
(set! n saved-n)
(apply-cont))))))
==>
(begin
(set! cont saved-cont)
(set! val (* val saved-n)) ;; changed here
(apply-cont)))
Page 196, Figure 6.2, next-to-last line of apply-cont:
(set! n saved-n)
=>
(set! val (* val saved-n))
Page 208:
a-program ==> cps-a-program
const-exp ==> cps-const-exp
var-exp ==> cps-var-exp
Page: 209:
The contract should be
apply-procedure/k : Proc * ExpVal * Cont -> ExpVal.
Also, "cps-" should precede "let-exp", "letrec-exp",
"if-exp", and "call-exp".
Page: 216:
Line 10 (line 4 of the second display):
The last paren should be preceded by ">>", leading to "exp_n>> K) >>)"
Lines 9 and 14 of the final display:
The two closing parentheses should each be preceded by ">>" leading to ">>) >>)"
Page 217:
Line 7 of last display
There is an unmatched set of <<'s and >>'s.
Need to move the '>>' to the next term following an equal sign
and have it follow the "K)"
Page 219:
The type and name say it is for cps-of-diff-exp, but
the code is for cps-of-sum-exp. So, we need the type:
cps-of-sum-exp : Listof (InpExp) * SimpleExp -> TfExp
Page 223-224
The code for cps-of-let-exp is incorrect, because it puts k-exp inside
the scope of id. The solution is to translate the 'let' into the immediate
application of a lambda expression. Then cps-of-exps will make the
needed fresh variables.
(define cps-of-let-exp
(lambda (id rhs body k-exp)
(cps-of-exp
(call-exp
(proc-exp (list id) body)
(list rhs))
k-exp)))
The proposed code in Exercise 6.27 suffers from the same error.
Page 223:
The type left off the type of the letrec-body.
It is, of course, just InpExp. Here is what the type should say.
;; cps-of-letrec-exp :
Listof(Listof(Var)) * Listof(InpExp) * InpExp * SimpleExp -> TfExp
Page 265
Section 7.4.3
optype ==> otype
Page 230
Line -4
apply-procedure ==> apply-procedure/k
Page 231
Line 2
apply-procedure ==> apply-procedure/k
Page 273
Exercise 7.28
In the example,
The first 'let' should be 'letrec', to fit into the syntax of INFERRED
Also
((foo f) cdr(x))) => (foo cdr(x)))
Page 290
Exercise 8.5
interface
[even : int -> bool
odd : int -> bool]
=>
interface
[even : (int -> bool)
odd : (int -> bool)]
Page 303:
(name type?) => (name symbol?)
Note: in the repo, this field is called t-name.
See chapter8/abstract-types-lang/static-data-structures.scm
Page 337 et seq:
The code in
https://github.com/mwand/eopl3/blob/master/chapter9/classes is
inconsistent . data-structures.scm defines ExpVal to include objects,
with the injector obj-val. However, the rest of the interpreter
doesn't use obj-val. Objects are passed around without the wrapper.
The code still works, because method-call-exp doesn't check to see
whether its argument is an object. method-call-exp should call a
function like expval->obj, in the same way that diff-exp calls
expval->num.
Page 341:
extend-env* => extend-env
Page 362:
2 lines above the display
instance => interface
Page 378: Line 2:
Delete ", and"