[Oberon] Clarifying type compatibility in Oberon-07

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Thu Oct 5 07:53:38 CEST 2017


> On 05 Oct 2017, at 06:51, Jörg <joerg.straube at iaeth.ch> wrote:
> 
> As I said, and you mentioned as well: BYTE/INTEGER can be seen as kind of Inclusion but it can also be seen differently.
> 
> The statement i := i + b is allowed in Oberon-07. So, you could say there is an implicit type cast for „b“, hence inclusion.
> 
> But I‘m open. It depends a little on what you mean by „inclusion“.
> 
> Jörg


I agree. We seem to be on the same page. My suggestion would still be to omit the section called “Type inclusion” (as shown below, taken from an earlier pos, but obsolete in Oberon-07) and simply treat BYTE/INTEGER wherever this is necessary in the actual type rules.

     Type inclusion
     Integer types include (the values of) smaller numeric types according to the following hierarchy:
     LONGREAL >= REAL >= LONGINT = INTEGER >= BYTE

-AP


More information about the Oberon mailing list