Article View: comp.lang.modula2
Article #149diff -c pim3 pim4
From: Martin Neitzel
Date: Sat, 24 Jun 1989 02:44
Date: Sat, 24 Jun 1989 02:44
291 lines
11425 bytes
11425 bytes
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<ntr*)
INCL(free[k DIV w], k MOD w)
END ReturnTrack;
--- 1269,1275 ----
END
END NewTrack;
! PROCEDURE ReturnTrack (k: INTEGER);
BEGIN (*assume 0<=k<ntr*)
INCL(free[k DIV w], k MOD w)
END ReturnTrack;
***************
*** 1345,1354 ****
to any variable of type T. TSIZE is of an arithmetic type depending
on the implementation.
- Examples:
-
- ADR(lastused) TSIZE(Node)
-
Besides those exported from the pseudo-module SYSTEM, there are two other
facilities whose characteristics are system-dependent. The first is
the possibility to use a type identifier T as a name denoting the
--- 1344,1349 ----
***************
*** 1366,1371 ****
--- 1361,1367 ----
expression enclosed in brackets immediately following the identifier
in the variable declaration. The choice of an appropriate data type
is left to the programmer.
+ For examples, refer to 13.2.
***************
*** 1402,1408 ****
This call suspends the current process, assigns it to p1, and resumes
the process designated by p2. Evidently, p2 must have been assigned a
process by an earlier call to either NEWPROCESS or TRANSFER. Both
! procedures must be imported.
A program terminates, when control reaches the end of a procedure
which is the body of a process.
--- 1398,1404 ----
This call suspends the current process, assigns it to p1, and resumes
the process designated by p2. Evidently, p2 must have been assigned a
process by an earlier call to either NEWPROCESS or TRANSFER. Both
! procedures must be imported from the module SYSTEM.
A program terminates, when control reaches the end of a procedure
which is the body of a process.
***************
*** 1429,1436 ****
in addition causes the interrupt transfer occurring upon device
completion to assign the interrupted process to p2 and to resume the
device process p1. va is the interrupt vector address assigned to the
! device. The procedure IOTRANSFER must be imported, and should be
! considered as PDP-11 implementation-specific.
It is necessary that interrupts can be postponed (disabled) at certain
times, e.g. when variables common to the cooperating processes are
--- 1425,1432 ----
in addition causes the interrupt transfer occurring upon device
completion to assign the interrupted process to p2 and to resume the
device process p1. va is the interrupt vector address assigned to the
! device. The procedure IOTRANSFER must be imported from the module
! SYSTEM, and should be considered as PDP-11 implementation-specific.
It is necessary that interrupts can be postponed (disabled) at certain
times, e.g. when variables common to the cooperating processes are
***************
*** 1498,1504 ****
operating on operands of this type, and in particular operating on its
components, must be defined in the same implementation module which
hides the type's properties. Opaque export is restricted to
! pointers.
Assignment and test for equality are applicable to all opaque types.
As in local modules, the body of an implementation module acts as an
--- 1494,1500 ----
operating on operands of this type, and in particular operating on its
components, must be defined in the same implementation module which
hides the type's properties. Opaque export is restricted to
! pointers and to subranges of standard types.
Assignment and test for equality are applicable to all opaque types.
As in local modules, the body of an implementation module acts as an
Technical Details
Message-ID:
<1291@infbs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!mcvax!unido!infbs!neitzelShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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