Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!ceriel From: ceriel@cs.vu.nl (Ceriel Jacobs) Newsgroups: comp.lang.modula2 Subject: Re: diff -c pim3 pim4 Message-ID: <2800@ceriel.cs.vu.nl> Date: 26 Jun 89 07:59:28 GMT References: <1291@infbs.UUCP> Reply-To: ceriel@cs.vu.nl (Ceriel Jacobs) Organization: VU Informatica, Amsterdam Lines: 91 Some time ago (in March 1989), I posted the following list of inconsistencies in PIM-4: ... (start of list) For instance, there an inconsistency between paragraph 9.2 and paragraph 10.1. In paragraph 9.2, page 144, we read: ... The types of corresponding actual and formal parameters must be *compatible* in the case of variable parameters ... (emphasis mine) but in paragraph 10.1, page 149, we read: ... The type of each formal parameter is specified in the parameter list. In the case of variable parameters it must be *identical* with its corresponding actual parameter ... (again, emphasis mine) Also, in chapter 12 of the book, paragraph 12.1, page 52, on variable parameters, we read: ... The types of corresponding formal and actual parameters must be the same ... In paragraph 12 of the Report, page 153/154, we read: ... The type ADDRESS .... is compatible with all pointer types ... ... If a formal parameter is of type ADDRESS, the corresponding actual parameter may be of any pointer type, even if the formal parameter is a VAR parameter ... If the types of the corresponding actual and formal parameter only have to be compatible, the last sentence quoted is a useless remark. Apparently, the texts of the 2nd and the 3rd edition got mixed up a bit. This supposition is supported by the following quote, from paragraph 14, page 156: ... Opaque export is restricted to pointers and to subranges of standard types ... This was in the 2nd edition. The 3rd edition limits opaque export to pointers only. Some more support for this supposition is found in Appendix 1. It contains the syntax of Modula-2, as it appeared in the 2nd edition, not the 3rd! This obviously is a mistake, because this grammar does not correspond to the pieces of grammar quoted in the Report. Also, the syntax diagrams in Appendix 4 are those of the 3rd edition, and thus do not correspond to the syntax in Appendix 1. Another problem is caused by the preface to the 4th edition. On page 5, we read: ... the definition of the language has also undergone a few minor adaptations in the area of Standard Functions: FLOAT(i) and CHR(i) accept an argument of type INTEGER TRUNC(x), HIGH(a), ORD(ch), and SIZE(T) are of type INTEGER However, in paragraph 10.2 of the report, page 150, we read: ... ORD(x) ordinal number (of type CARDINAL) ... The text in the first 5 lines of paragraph 8.2, page 141, got mangled. I assume that the intention for variable parameters is, that the types of the corresponding formal and actual parameters must be identical, like in the 3rd edition. For opaque types, however, it is not clear to me whether the change back to the 2nd edition was intentional or accidental. ... (end of list) I also wrote a letter about this to Prof. Wirth. His reaction contained the following paragraph (copied verbatim): You are of course right in assuming that while editing parts of the 2nd edition slipped in. The types of VAR parameters must not only be compatible, but identical. Opaque type continue to be restricted to pointers. I am particularly dismayed that the Syntax (App. 2) is wrong; it should be replaced by that of the 3rd Edition. So, don't believe the 4th edition! -- Ceriel Jacobs, Dept. of Mathematics and Computer Science, Vrije Universiteit, De Boelelaan 1081, 1081 HV Amsterdam, The Netherlands Voice: +31 20 5485577 Email: ceriel@cs.vu.nl -- Ceriel Jacobs, Dept. of Mathematics and Computer Science, Vrije Universiteit, De Boelelaan 1081, 1081 HV Amsterdam, The Netherlands Voice: +31 20 5485577 Email: ceriel@cs.vu.nl