From: harbison@bert.pinecreek.com (Sam Harbison)
Newsgroups: comp.lang.modula3
Subject: Errata, Modula-3 (addendum)
Date: 9 Apr 92 18:17:12 GMT
Organization: Pine Creek Software, Pittsburgh PA

Since I posted an errata list for _Modula-3_ on March 24, a number of
other comments turned up. Here is a posting of the revised list. For
those of you who incorporated the older version, the only significant
changes are on pp. 5, 43, 75, and 177.  The complete list of changes
are pages 5, 35, 43, 75, 90, 155, 177, 178, 180, 191, 212, and 311.

	Errata: Modula-3
	(Prentice Hall, 1992)
	Samuel P. Harbison
	April 9, 1992

1.  Errata by Page

Line number "n" is the n'th line from the top of the page; line number 
"-n" is the n'th line from the bottom of the page. An "x" in the column 
labeled "Chg" means that the correction was supplied to the publisher and 
will appear in a future printing; no entry in that column means the problem 
was not considered serious enough to correct.

Page:Line:Chg:Description

1:-4:x:Change "it easy" to "it is easy".

3:-6:x:Change "MODULE Main" to "MODULE Hello1 EXPORTS Main".

3:-1:x:Change "END Main" to "END Hello1".

5:11:x:The sentence should read, "Therefore, the characters MODULEHello1 
	would be considered a single identifier rather than the reserved 
	word MODULE followed by the identifier Hello1." This was correct 
	in the first printing, but "MODULEHello1" may appear as "MODULE 
	Hello1" in the second printing.

5:-5:x:Change "MODULE Main" to "MODULE Hello1 EXPORTS Main".

5:-4:x:Change "END Main" to "END Hello1".

8:7:x:Change "Hello, World!" to "Hello, World!\n"

8::x:Swap positions of Example 1-4 and Figure 1-3.

10:-4:x:Rewrite last paragraph; mention left-associativity.

20:-5:x:Mention that loop variable i is declared in FOR statement.

20::x:Swap positions of Box and Example 2-5.

32:1:x:Add space before "By".

32:6:x:Change "n := n" to "n := BITSIZE(n)"

32:7:x:Add "because the result type of BITSIZE is always CARDINAL."

33:-4:x:Add missing ")" at end of declaration.

33:-5:x:Add missing ")" at end of declaration.

33:8:x:Fix typeface in exercise 4d.

35:1::Change "fifteen" to "eighteen."

38:-17::Change "a,pos" to "a, pos".

43:5:x:The box "Variations on Procedure Calls" makes an inaccurate statement 
	about Modula-2. Modula-2 requires "()" in function calls but not 
	in proper procedure calls.

49:8::"Solution" should be boldface.

50:1::In box, keywords should not be boldface.

57:-9:x:Rephrase as: "Which of the three versions is more readable?"

57:-5:x:Change "page 49" to "page 50".

64:-10:x: -8 MOD 3 is 1, not -1.

64:-5:x:x MOD 2 is 1 if x is odd; it cannot be -1.

67:19::Change "volume : [0..10]" to "volume: [0..10]".

74:-4:x:Add: The type of FIRST and LAST is the base type of T.

74:-4:x:Add: The type of NUMBER is CARDINAL.

74:-3:x:Add: "and has type T" to example of FIRST and LAST.

75:15:3:The solution presented in Example 4-14 doesn't work when VolumeLevel 
	is an enumeration or an integer subrange. The problem is that the 
	value of NewVolume may lie outside the range of VolumeLevel and 
	therefore cause a run-time error. Here is the new example and
	a revised following paragraph

    Example 4-14    

    Rewrite procedure ChangeVolume in Example 4-8 on page 67 assuming
    VolumeLevel is defined as the enumeration type {Off, Soft, Medium,
    Loud, Ear_splitting}.

    SOLUTION  You cannot compute the tentative value of NewVolume as
    VAL(ORD(volume)+n, VolumeLevel) without getting a checked run-time
    error if n is too large or too small. This makes the procedure
    somewhat more cumbersome. Here is one possibility, in which the
    range testing is hidden in the functions MIN and MAX:

	PROCEDURE ChangeVolume(n: INTEGER) =
	  BEGIN
	    WITH 
	      biggest  = ORD(LAST(VolumeLevel)),
	      smallest = ORD(FIRST(VolumeLevel)),
	      proposed = ORD(volume) + n
	    DO
	      volume := VAL(MAX(MIN(biggest,proposed),smallest),VolumeLevel);
	    END;

	  END ChangeVolume;

  Now suppose that v has the subrange type [T.A..T.B]. For the assignment 
  v := e to be legal, the type of e must either be T or else it must be a 
  subrange of T that includes at least one value in T.A..T.B. That is, the 
  types of v and e must share at least one value. Even if the assignment 
  is legal, it is a checked run-time error if the actual value of e is not 
  in T.A..T.B.

90:6:3:Change "Ans" to "answer".

111:6:x:Change "Point, the" to "Point (page 107), the".

111:-6:x:Change "SET OF t" to "SET OF T".

112:-5::Change "CARDINALITY" to "Cardinality".

112:-2::Identifiers in italics should be in the program typeface.

113:3:x:Change ":=" to "=".

129:1:x:Remove "[A]".

129:-3:x:Add "(or LAST(CARDINAL) if the array is empty)" before ":".

129:-10:x:Change "the procedure" to "ForAllElements".

134:-18::Change "out.If" to out. If".

136:1::In the box, the keyword ELSE should not be boldface.

141:18:x:Change "in procedure Forever" to "in the procedure".

141:-14:x:Change "ELSE =>" to "ELSE".

141:-9:x:Change "Chapter 12 (Threads)" to "Chapter 12".

155:-2:x:The last sentence should read: "Ordinary clients will import only 
	Basic, while trusted clients will import both Basic and Friendly 
	(Figure 8-5)."

168:1::In box, keyword "END" should not be boldface.

176:-9::Change "P" to "p" (four times) in Ex. 10-1 and following text.

177:-3:x:Change "beta := beta;" to "beta := alpha;"

178:-1:x:Add NEW to the list of builtin functions for reference types.

180:19::Add a semicolon after "theta := Math.Pi / 2.0".

191:-19::Change "IMPORTS Rational" to "IMPORT Rational".

212:-4::Since TL=TR implies TL<:TR, the first entry in the third row of 
	the table is understood to mean TL<:TR AND TL#TR. The table layout 
	already suggests this interpretation.

214::x:Add "RETURN self" to InitPostion and InitRectangle.

214:-19:x:Editorial changes to paragraph "The Rectangle.init method...".

218::x:Add "RETURN self" to InitPosition and InitRectangle.

219::x:Add "RETURN self" to InitCircle.

219:-8:x:Editorial changes were made to the last paragraph.

226:-7::Change typeface of "Child".

227:8:x:Mention that untraced things are discussed in 13.2 on p. 258.

227:-6:x:Change typeface of "name".

234::x:Change "94681" to "94861" (four times).

296:-7::Change "=QualID" to "= QualID".

299:7:x:The answer to D.1.5(c) is 11, not 3.

300:8:x:Change "a := y" to "b := y".

300:-16:x:Change all "A" and "B" to "a" and "b" in answer to exercise 9.

300:-11:x:Delete procedure heading; the solution is a block statement.

305:::Correct typeface of leading entry in letter groups as necessary.

305:::Add "Alerted (Thread)" to the index (cite p. 250)

311:4::Change "Subtypes (see Types)" to "Subtypes (see Type)".

2.  Errata History

This section lists the errata according to the date they were entered into 
the list.

2.1  March 24, 1992

Pages 1, 3, 5, 8, 10, 20, 32, 33, 56, 57, 64, 74, 111, 113, 129, 141, 214, 
218, 219, 227, 234, 299, 300.

These changes should be reflected in the book beginning with the second 
printing.

2.2  March 31, 1992

Pages 5, 35, 43, 75, 90, 155, 177, 178, 180.

These changes should be reflected in the book beginning with the second 
or third printing.

2.3  April 9, 1992

Pages 191, 212, 311.
Newsgroups: comp.lang.modula3