[Oberon] Clarifying type compatibility in Oberon-07

Jörg joerg.straube at iaeth.ch
Thu Oct 12 14:46:05 CEST 2017


* MODULE M; (*test of the implementation of Oberon-07 as of 12.10.17*)
*     VAR

*     p, q: ARRAY 10 OF INTEGER;
*     r, s: ARRAY 10 OF INTEGER;

*     e, f: PROCEDURE (i, j: INTEGER);
*     g, h: PROCEDURE (i, j: INTEGER);

*   a, b: RECORD i, j: INTEGER END ;
*     c, d: RECORD i, j: INTEGER END ;

*   p := q; (*ok -> same array types*)


I see it the same: allow


*   p := r; (*ok -> structural equivalence suffices*)


Acc 9.1 only allowed for open array. So, I see this as compiler bug.

A hint why it is a compiler bug: If the structural equivalence was included in SAME, exception 4 mentioned in 9.1 would not be needed.

So, it is in my view wrong to include structural equivalence in SAME.

*   e := f; (*ok -> same procedure types*)


I see it the same: allow

*   e := g; (*ok -> structural equivalence suffices*)


My interpretation of 6.5: only allowed it for (const) P. A “g” is a variable, I would not allow.

*   a := b; (*ok -> same record types*)


I see it the same: allow

*   a := c  (*illegal assignment -> no structural equivalence for records*)


I see it the same, don’t allow





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20171012/1e9a5951/attachment.html>

More information about the Oberon mailing list