[Oberon] Clarifying type compatibility in Oberon-07
Jörg
joerg.straube at iaeth.ch
Thu Oct 5 10:20:58 CEST 2017
August
>>> * Under "Assignment compatible" you don't mention assignment of open arrays.
>>
>> open arrays only exist as formal parameter of a procedure not as a variable. Assignment rules are for variables. In my point of view open arrays are covered in Array rule 2.
> I'm talking about paragraph 4 in section 9.1 of the Oberon-7 language
> a: ARRAY 10 OF INTEGER;
> b: ARRAY 10 OF INTEGER;
> a := b;
9.1.1 is covered by Assignment rule 5
9.1.2 is covered by Assignment rule 6
9.1.3 is covered by Assignment rule 3
9.1.4 is indeed an interesting one
Here an example to demonstrate what 9.1.4 says:
VAR global: ARRAY 20 OF INTEGER;
PROCEDURE A (open: ARRAY OF INTEGER)
VAR local: ARRAY 10 OF INTEGER
BEGIN
local := open (* this is mentioned in 9.1.4 *)
END A;
BEGIN
A(global) (* this is covered by Array rule 2 *)
END.
Two remarks:
Indeed 9.1.4 is not covered by any of the existing rules of Appendix A.
On the other hand, I can’t find where your example of a := b is mentioned in the Oberon-07 report (independent of the fact that the compiler allows it..)
br
Jörg
More information about the Oberon
mailing list