As of October 2003 Programming Language Pragmatics is in the fifth printing of its first edition. To tell which printing you have, check the copyright page. Three lines below the copyright symbol there is a line of numbers. If the last number is a 1 you have the first printing. If the last number is a 2 you have the second printing. If the last number is a 3 you have the third printing, etc.
)
": relabel
"non- )
or *
".
+
" should be
replaced by "add_op", with a "+
" child;
node labeled "/
" should be replaced by
"mult_op", with a "/
" child.
inner
" with "B
". Make the same change
in the first line of the immediately following paragraph.
i +:=
by
" with "i := i + by
"; lines 5 and 10:
replace "yield i
" with "yield(i)
";
last line of top (partial) paragraph: replace "last - first" with
"(last - first)".
yield
; line 9: replace "from_to
" with
"int$from_to
"; line 12: replace "{l, r}
"
with "{left: l, right: r}
".
square
, and the intervening text, with:
fun square(x) = x * x;
Here the compiler cannot tell whether
*
is meant to refer to integer or floating-point multiplication; it assumes the former by default. If this is not what the programmer wants, the alternative must be specified explicitly:
fun square(x : real) = x * x;
a
"
with "b
".
);
" with ", r[i]);
".
&s
" with "%s
".
delete
"
with "delete[]
".
>
" with ">=
".','(rainy(rochester), ','(rainy(seattle), ','(cold(rochester), :-(snowy(X), (rainy(X), cold(X))))))
+
, -
," at
the beginning of the PREDICT set for factor_tail
→ ε.
good(A) :-
block_split(A).
" and "good(A) :- build(A).
"
with "good(A) :- strong_build(A).
" and "good(A)
:- weak_build(A).
" Then on p. 634, replace five lines
starting with "Our fourth choice" with
Our fourth choice is to build toward three in a row (i.e., to get two in a row) in such a way that the obvious blocking move won't allow our opponent to build toward three in a row:Make the same code changes on p. 639, figure 11.7. Finally, in that same figure, delete the secondstrong_build(A) :- x(B), line(A, B, C), empty(C), not(risky(C)). risky(C) :- o(D), line(C, D, E), empty(E).Barring that, our fifth choice is to build toward three in a row in such a way that the obvious blocking move won't give our opponent a split:weak_build(A) :- x(B), line(A, B, C), empty(C), not(double_risky(C)). double_risky(C) :- o(D), o(E), different(D, E), line(C, D, F), line(C, E, G), empty(F), empty(G).
done
rule and replace the play
rule with
play :- not(clear), repeat, getmove, respond. respond :- ordered_line(A,B,C), o(A), o(B), o(C), printboard, write('You won.'), nl. % shouldn't ever happen! respond :- makemove, printboard, done.
write
statement.
write
statement.
,
id_list" with ", id
id_list_tail".
A, B, C;
, using" (with "A, B, C;
"
in typewriter font).