[Oberon] Clarifying type compatibility in Oberon-07

August Karlstrom fusionfile at gmail.com
Wed Oct 4 08:37:50 CEST 2017


Oberon-2 has the following definition of *same type* in appendix A in 
the language report:

Two variables a and b with types Ta and Tb are of the same type if
1. Ta and Tb are both denoted by the same type identifier, or
2. Ta is declared to equal Tb in a type declaration of the form Ta = Tb, or
3. a and b appear in the same identifier list in a variable, record 
field, or formal parameter declaration and are not open arrays.

As far as I understand, Oberon-07 uses structural equivalence for array 
and procedure types so we must add two paragraphs to this list:

4. Ta and Tb are array types whose element types and lengths are the 
same, or
5. Ta and Tb are procedure types whose formal parameter lists match.

In appendix A we also need to

* remove SHORTINT and LONGINT and add BYTE,

* remove type inclusion,

* add two paragraphs to the definition of "assignment compatible":

8. Te is BYTE and Tv is INTEGER or vice versa;
9. Te is an open array and Tv is an array with the same element type 
(and length?) as Te.

Is Oberon-07 compatible with appendix A after these changes have been made?

http://www.math.bas.bg/bantchev/place/oberon/Oberon2-Report.pdf


Regards,
August


More information about the Oberon mailing list