[Oberon] CASE without ELSE
joerg.straube at iaeth.ch
Thu Feb 15 23:31:56 CET 2018
I don‘t understand your comment; where exactly do you see problems?
I know that the code below can not be compiled as ORP.Mod did not implement the numerical case (yet) but it is valid Oberon-07 code.
> Am 15.02.2018 um 22:42 schrieb Diego Sardina <dsar at eml.cc>:
>> On Thu, Feb 15, 2018, at 10:26 PM, Jörg Straube wrote:
>> Based on Chris‘ example you could write
>> CASE String.Pos(ch, "ILTQX", 0) OF
>> -1: (* else case *)
>> | 0: (* inspect *)
>> | 1: (* load *)
>> | 2: (* transfer *)
>> | 3: (* quit *)
>> | 4:
> Chris didn't write that form because case labels in Oberon-07 are not ConstExpression anymore (a negative number is considered a form of expression). Only integers, single character strings or qualidents (for the typecase form).
> This is a sort of simplification because there is no more a need for an offset
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
More information about the Oberon