[Oberon] Case statements containing base type labels

Chris Burrows cfbsoftware at gmail.com
Mon Aug 28 15:20:33 CEST 2023


On Mon, Aug 28, 2023 at 10:00 PM August Karlstrom <fusionfile at gmail.com>
wrote:

>
> However, the same dilemma occurs also if we consider strict extensions,
> for example
>
>         CASE animal OF
>                 Squirrel: ... |
>                 Whale: ... |
>                 Mammal: ...
>         END
>
>

This is just equivalent to (and makes as much sense as):

   IF animal IS Squirrel THEN ...
   ELSIF animal IS Whale THEN ...
   ELSIF animal is Mammal THEN ...
   END

Refer to the pair of examples on P 61 of  Programming in Oberon, 2014:

https://people.inf.ethz.ch/wirth/Oberon/PIO.pdf

Regards,
Chris

--
Chris Burrows
CFB Software
https://www.astrobe.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20230828/c6271f25/attachment.html>


More information about the Oberon mailing list