[Oberon] Clarifying type compatibility in Oberon-07

August Karlstrom fusionfile at gmail.com
Thu Oct 5 17:12:24 CEST 2017


On 2017-10-05 14:28, Jörg wrote:
> 
>      An expression e of type Te is assignment compatible with a variable v of
>      type Tv if one of the following conditions hold:
>      1. Te and Tv are the same type;
>      *2. Te and Tv are different integer types;
>      3. Te and Tv are record types and Te is an extension of Tv and the
>      dynamic type of v is Tv ;
>      4. Te and Tv are pointer types and Te is an extension of Tv;
>      5. Tv is a pointer or a procedure type and e is NIL;
>      6. Tv is ARRAY n OF CHAR, e is a string constant with m characters, and
>      m < n;
>      *7. Te and Tv are procedure types whose formal parameter lists match;
>      *8. Tv is CHAR and e is a single-character string constant;
>      *9. Tv is an array type and Te is an open array type with the same
>      element types as Tv.
>      
> I can agree on 2, 8 and 9. Why do you want to change the original wording of 7.

It's for the use of structural equivalence in assignment of procedure 
*variables*.

Anyway, I have been in contact with Niklaus Wirth and he says that 
structural equivalence used in assignment of (non-open) array and 
procedure variables should be considered as "an addition to the language 
definition". Therefor list item 7 above should be left unchanged as you 
suggested.


-- August


More information about the Oberon mailing list