[Oberon] CASE without ELSE

Diego Sardina dsar at eml.cc
Thu Feb 15 19:07:26 CET 2018


On Thu, Feb 15, 2018, at 6:11 PM, Jörg wrote:
> We can certainly debate heavily whether there is really a big aesthetical difference:
>  

I wasn't debating this simple case, but in the scanner various IFs were nested to reduce the number of tests

>  
> How often did you use CASE in the past?
> When you want constant runtime, you could write something like.
>  
> VAR Statements: ARRAY 10 OF PROCEDURE;
> Statements[x];

This is overkilling for simple cases.

And semantically not the same, what if you need to access a local variable? This means an additional parameter to the procedure variable.

Jump tables are very compact (and efficient) in this regard since they don't have the overhead of a procedure call.




More information about the Oberon mailing list