[Oberon] Case statements containing base type labels

August Karlstrom fusionfile at gmail.com
Mon Aug 28 19:27:44 CEST 2023


On 2023-08-28 15:20, Chris Burrows wrote:
> Refer to the pair of examples on P 61 of Programming in Oberon, 2014:
> 
> https://people.inf.ethz.ch/wirth/Oberon/PIO.pdf 
> <https://people.inf.ethz.ch/wirth/Oberon/PIO.pdf>

The examples you refer to in "Programming in Oberon" are in the context 
of message records and all labels are (proper) direct extensions of the 
base type Message so there is no ambiguity in this case; the labels can 
be arranged in any order without affecting the behavior of the case 
statement (as it should be).

My current conclusion is that a case statement where one type label is 
an extension of another is not well-defined. I think an ambitious 
compiler could even reject such a statement, similar to how repeated 
case labels can be handled.


/August


More information about the Oberon mailing list