[Oberon] CASE without ELSE

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Fri Feb 16 11:13:57 CET 2018


  > My interpretation of what might have happened is this:
  > In Oberon07 the numeric CASE had been dropped, but later
  > it has been reintroduced but the ELSE has been forgotten.

That’s one possibility. Another possibility would be that
it was dropped but the grammar was not fully restricted
to the non-numerical case, i.e. only the ELSE was removed
but not the fact that that case expression can an integer.

Either way, we now have a language spec that contains the
numerical case, but an implementation that doesn’t.

   > To me, a numeric CASE without an ELSE is pointless.

Agreed. It was the absence of the ELSE clause and the fact
that the numeric case hadn’t been implemented in PO2013
for ~5 years now that caused me to believe that the
intended main use of the CASE statement is with records
and pointer types (i.e. to check extension levels),
where the ELSE clause is indeed not needed, since it
is implicit if the base type appears as the last case.

  > My conclusion so far is: If the numeric CASE is not
  > implemented but only specified, it should not be
  > taken literally.

Extensions levels are (internally) also numbers of course ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20180216/e4f3a50f/attachment.html>


More information about the Oberon mailing list