ERRATA IN "ML for the Working Programmer", 3rd printing ** Chapter 1 ** 1, 1: The first ML compiler was built in 1974! ** Chapter 2 ** 15, -8: sqrt should be in italics! 34, middle: power should be pow 45, line -9: sentence should end with a period 48, Line 9 (Ray Toal): "itfib(0,8,13)" should be "itfib(1,8,13)" 53, bottom (Guo-Qiang Zhang): function pos only works if its argument is congruent to 1 (mod 4) while neg only works if its argument is congruent to 3 (mod 4). This can be seen by inspecting the denominator of the final term, positive or negative. A function to call pos with correct arguments is fun piapprox n = 4.0 * pos (real (4*n+1)); Recall however that convergence is too slow to be of practical value. ** Chapter 3 ** 73, line 16 (Allen Stoughton): 505,000 should be 500,500 [91, 92: Note that the result of the depth-first search appears in reverse order. Perhaps the display should use "rev(depthfirst ...)"??] 99 (Mike Fourman): sorting idea is originally due to Bencher (see Knuth, The Art of Computer Programming, vol III, section 5.4.5). 100 (Mike Fourman): the call to sorting should be sorting(xs, [[]], 0) in order to handle the case xs=[]. The same applies to samsorting, eliminating the need for an extra clause in samsort. ** Chapter 4 ** 119, line -4 (Matthew Arcus): "codes" should be "nodes" 125, line -3: "Function" should be lower case. [133-136: A. C. Norman reports a much simpler and faster version of heap sort. See the second edition...] ** Chapter 5 ** ** Chapter 6 ** 215, Exercise 6.24 (Silvio Meira): f has to be associative and e needs to be a left identity. Insert "Let $\odot$ be as in the previous exercise." and replace f by (\ttb{op}\odot). ** Chapter 7 ** 238, line -10: "stores a queue as a pair of lists" (insert "a") 264, omitted the response to the insertion of "Crecy" (same as previous line) ** Chapter 8 ** 296, exercise 8.11: "Difficulty ^ showing" (insert "of") 303 : the code for sub needs, around the Array.sub call, the exception handler handle Subscript => raise E Also, array(n,x) should test for n<0 not n<=0. 306, Line -6 (Mike Gordon). Is the response to "print(sqrt 2.0)" correct? (a) The value of print(x) is NOT x under New Jersey ML. (b) No compiler prints exactly what's shown in the text, e.g. they include val it = ". 308, exercise 8.25. The undocumented command "flush_out" is needed to solve this in the most robust way. ** Chapter 9 ** 312 (Reuben Thomas): penultimate line: Block(es,indent... should be Block(es, indent... 317 (Reuben Thomas): change _ in first line of drop to n 320 (Reuben Thomas): \, should be \\, In the source \ttbacksl, should be \ttbacksl\ttbacksl, Or else perhaps most of the line should be enclosed in \verb9...9 323 (Reuben Thomas): extra space before "toks" in the warning message. In the source, replace "omitting ~$toks$" by "omitting~$toks$" 342 (Reuben Thomas): fun makelambda would more consistently finish with a ;. In the definition of term, first( needs a space before it. 344 (Reuben Thomas): the second line of applic seems oddly tabbed: close up 405: Problem 41 is really problem 42! 407: Add to Bibliography before Boyer: George S. Boolos and Richard C. Jeffrey (1980) Computability and Logic, CUP. 409 (Andrew Morris) Add to Bibliography before Oppen: F. Oppacher \& E. Suen (1988). HARP: A tableau-based theorem prover. {\it Journal of Automated Reasoning}, 4:69--100. **** Syntax diagram errors found by Gary Leavens **** There is no way to get out of Specification (on page 413), Declaration (page 414), and Datatype Binding (on 415). Add a downwards-pointing arrow on the right side of each.