-
Notifications
You must be signed in to change notification settings - Fork 0
Revision Changes
-
A declaration states that an entity exists.
-
A definition defines and institutes the entity.
To be consistent, proper nomenclature requires a change of the syntax for the module headers of so called 'definition' modules to either declaration or interface modules. Since their primary purpose is that of interface, they are renamed to interface modules and their module header syntax changed to
INTERFACE MODULE Ident;
Since this is perhaps the most intrusive change
in the entire revision, our compiler implements
DEFINITION
as a synonym for INTERFACE
to ease
the transition for users of classical Modula-2.
The associated file type is .ifm
but the
continued use of .def
is permissible.
For the benefit of clarity to human readers, it is
recommended to use .def
for interface modules that
only contain constant, variable and type definitions
and thus lack an implementation counterpart.
Use OPAQUE
alone instead of OPAQUE POINTER
.
TYPE Foo = OPAQUE; (* opaque pointer type *)
Legal:
PROCEDURE P ( arg : CAST OCTETSEQ );
Illegal:
VAR s : OCTETSEQ;
RECORD field : OCTETSEQ; ... END;
Use of reserved words instead of single characters:
Old syntax:
PROCEDURE [NEW+] NewWithArgs ( ... );
New syntax:
PROCEDURE [NEW ARGLIST] NewWithArgs ( ... );
Old syntax:
PROCEDURE [NEW#] NewWithCapacity ( ... );
New syntax:
PROCEDURE [NEW CAPACITY] NewWithCapacity ( ... );
Old syntax:
PROCEDURE [READ*] ReadNew ( ... );
New syntax:
PROCEDURE [READ NEW] ReadNew ( ... );
However, the single character attribute #
for
formatted writing remains:
PROCEDURE [WRITE #] WriteF ( ... );
This maps 1:1 to the WRITE
statement syntax
WRITE #("5;2", amount);
and its use in the binding is thus intuitive.
use { TMIN(ValueType) .. TMAX(ValueType) }
instead of {*}
Copyright (C) 2023 Modula-2 Software Foundation