[Oberon] CASE in Project Oberon, Revised Oberon

David Egan Evans sinuhe at xmission.com
Wed May 7 15:19:32 CEST 2014


> given the change to label ranges outlined above 
and the removal of the default (ELSE) clause -- implementational
> simplicity and efficiency have trumped expressiveness, limiting the 
utility of CASE.

CASE is a replacement for WHILE, IF, WITH combination as a type guard. (See section 12.4 of Project Oberon.)

The removal of ELSE is offset by the subtle change of no requirement for a match, i.e. it doesn't have to be an error if there is no match.

There is some debate as to whether CASE, which uses a jump table, is really more expressive or efficient. An ELSE can make unclear authorial intent, and this new change ensures greater clarity. The use described in Project Oberon, and hinted at in PIM (at least my PIM4 copy), are the use I've seen in Wirth's source, where it is otherwise noticeably absent. (Compiler Construction still uses ELSE in an example.)
-- 
D. E. Evans


More information about the Oberon mailing list