Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!mcvax!unido!infbs!neitzel From: neitzel@infbs.UUCP (Martin Neitzel) Newsgroups: comp.lang.modula2 Subject: diff -c pim3 pim4 Message-ID: <1291@infbs.UUCP> Date: 24 Jun 89 02:44:00 GMT Organization: TU Braunschweig,Informatik,West Germany Lines: 291 This is a context diff of the 3rd and the 4th edition of "Programming in Modula-2". *** pim3 Sat Jun 24 01:33:31 1989 --- pim4 Sat Jun 24 01:33:29 1989 *************** *** 96,103 **** sequences of digits. If the number is followed by the letter B, it is taken as an octal number; if it is followed by the letter H, it is taken as a hexadecimal number; if it is followed by the letter C, it ! denotes the character with the given (octal) ordinal number (and is of ! type CHAR, see 6.1). An integer i in the range 0 <= i <= MaxInt can be considered as either of type INTEGER or CARDINAL; if it is in the range MaxInt < i <= --- 96,103 ---- sequences of digits. If the number is followed by the letter B, it is taken as an octal number; if it is followed by the letter H, it is taken as a hexadecimal number; if it is followed by the letter C, it ! denotes the character with the given (octal) ordinal number and is of ! type CHAR (see 6.1), i.e. is a character constant. An integer i in the range 0 <= i <= MaxInt can be considered as either of type INTEGER or CARDINAL; if it is in the range MaxInt < i <= *************** *** 131,137 **** A string consisting of n characters is of type (see 6.4) ! ARRAY [0..n-1] OF CHAR Examples: "MODULA" "Don't worry!" 'codeword "Barbarossa"' --- 131,137 ---- A string consisting of n characters is of type (see 6.4) ! ARRAY [0..n] OF CHAR Examples: "MODULA" "Don't worry!" 'codeword "Barbarossa"' *************** *** 548,557 **** 8.2. Operators The syntax of expressions specifies operator precedences according to ! four classes of operators. The operator NOT has the highest ! precedence, followed by the so-called multiplying operators, then the ! so-called adding operators, and finally, with lowest precedence, the ! relational operators. Sequences of operators of the same precedence are executed from left to right. $ expression = SimpleExpression [relation SimpleExpression]. --- 548,557 ---- 8.2. Operators The syntax of expressions specifies operator precedences according to ! four classes of operators. The operator NOT has the highest prcits ! execution, i.e. for the "returned" value. The (types of these) actual ! parameters must correspond to the formal parameters as specified in ! the procedure's declaration (see operators of the same precedence are executed from left to right. $ expression = SimpleExpression [relation SimpleExpression]. *************** *** 705,712 **** `assignment compatible', if either they are compatible or both are INTEGER or CARDINAL or subranges with base types INTEGER or CARDINAL. ! A string of length n1 can be assigned to a string variable of length ! n2 > n1. In this case, the string value is extended with a null character (0C). A string of length 1 is compatible with the type CHAR. --- 705,712 ---- `assignment compatible', if either they are compatible or both are INTEGER or CARDINAL or subranges with base types INTEGER or CARDINAL. ! A string of length n1 can be assigned to a array variable with n2 > n1 ! elements of type CHAR. In this case, the string value is extended with a null character (0C). A string of length 1 is compatible with the type CHAR. *************** *** 740,747 **** actual parameter must be an expression. This expression is evaluated prior to the procedure activation, and the resulting value is assigned to the formal parameter which now constitutes a local variable. The ! types of corresponding actual and formal parameters must be identical ! in the case of variable parameters, or assignment compatible in the case of value parameters. $ ProcedureCall = designator [ActualParameters]. --- 740,747 ---- actual parameter must be an expression. This expression is evaluated prior to the procedure activation, and the resulting value is assigned to the formal parameter which now constitutes a local variable. The ! types of corresponding actual and formal parameters must be compitable ! in the case of variable parameters and assignment compatible in the case of value parameters. $ ProcedureCall = designator [ActualParameters]. *************** *** 1094,1100 **** CHR(x) the character with ordinal number x. CHR(x) = VAL(CHAR,x) ! FLOAT(x) x of type CARDINAL represented as a value of type REAL. HIGH(a) high index bound of array a. --- 1094,1100 ---- CHR(x) the character with ordinal number x. CHR(x) = VAL(CHAR,x) ! FLOAT(x) x of type INTEGER represented as a value of type REAL. HIGH(a) high index bound of array a. *************** *** 1111,1121 **** CARDINAL. SIZE(T) the number of storage units required by a ! variable of type T, or the number of storage ! units required by the variable T. TRUNC(x) real number x truncated to its integral part ! (of type CARDINAL). VAL(T,x) the value with ordinal number x and with type T. T is any enumeration type, or CHAR, --- 1111,1120 ---- CARDINAL. SIZE(T) the number of storage units required by a ! variable of type T. TRUNC(x) real number x truncated to its integral part ! (of type INTEGER). VAL(T,x) the value with ordinal number x and with type T. T is any enumeration type, or CHAR, *************** *** 1151,1156 **** --- 1150,1156 ---- Objects local to a module are said to be at the same scope level as the module. They can be considered as being local to the procedure enclosing the module but residing within a more restricted scope. + The module identifier is repeated at the end of the declaration. $ ModuleDeclaration = $ MODULE ident [priority] ";" {import} [export] block ident. *************** *** 1158,1164 **** $ export = EXPORT [QUALIFIED] IdentList ";". $ import = [FROM ident] IMPORT IdentList ";". - The module identifier is repeated at the end of the declaration. The statement sequence that constitutes the `module body' is executed when the procedure to which the module is local is called. If several modules are declared, then these bodies are executed in the sequence --- 1158,1163 ---- *************** *** 1251,1257 **** w = 16; (* word size*) m = ntr DIV w; ! VAR i: CARDINAL; free: ARRAY [0..m-1] OF BITSET; PROCEDURE NewTrack(): INTEGER; --- 1250,1256 ---- w = 16; (* word size*) m = ntr DIV w; ! VAR i: INTEGER; free: ARRAY [0..m-1] OF BITSET; PROCEDURE NewTrack(): INTEGER; *************** *** 1258,1264 **** BEGIN (*reserves a new track and yields its index as result, if a free track is found, and -1 otherwise*) ! VAR i,j: CARDINAL; found: BOOLEAN; BEGIN found := FALSE; i := m; REPEAT DEC(i); j:=w; REPEAT DEC(j); --- 1257,1263 ---- BEGIN (*reserves a new track and yields its index as result, if a free track is found, and -1 otherwise*) ! VAR i,j: INTEGER; found: BOOLEAN; BEGIN found := FALSE; i := m; REPEAT DEC(i); j:=w; REPEAT DEC(j); *************** *** 1270,1276 **** END END NewTrack; ! PROCEDURE ReturnTrack (k: CARDINAL); BEGIN (*assume 0<=k