[Oberon] CASE without ELSE
josef.templ at gmail.com
Fri Feb 16 10:42:41 CET 2018
The latest Oberon language definition by NW that I have found is Revision
1.10.2013 / 3.5.2016
It does have a numeric CASE statement.
My interpretation of what might have happened is this:
In Oberon07 the numeric CASE had been dropped, but later it has been
but the ELSE has been forgotten.
To me, a numeric CASE without an ELSE is pointless.
The compiler needs to emit a range check anyway for generating a TRAP if
there is no ELSE.
The ELSE part comes (almost) for free.
If the ELSE check is done outside the CASE, it is actually done twice.
In contrast to some postings, by the way, the labels are not forced to
start with 0
and they can also be negative (by specifying a negative named constant).
In a real implementation, it would be much simpler to allow any ConstantExpr
of appropriate result type, though.
My conclusion so far is: If the numeric CASE is not implemented but only
it should not be taken literally.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Oberon