[Oberon] LONGINT, RETURN & etc.

Jörg joerg.straube at iaeth.ch
Fri Jun 9 18:49:35 CEST 2017


okay. I try to explain with other words:
formerly we had a construct like
   "RETURN" (expression)
as a (statement').
(expression) allows to write values and or formulas.
The consequence of that syntax was, that you could use RETURN in an IF THEN END construct as between "THEN" and "END" you can have as many (statement)s as you like.

Now the syntax
     "RETURN" (expression)
still exists but not as part of (statement). Due to this syntax change it is only allowed to be used ONCE in a PROCEDURE block.

Did this ecplanation help?


> Am 09.06.2017 um 17:30 schrieb Skulski, Wojciech <skulski at pas.rochester.edu>:
>  ...
>> 3. The RETURN statement has been discarded ..."
>> While in Peter De Wachter's emulator,
> MODULE Edit; (*JG 2.11.90 / NW 28.11.2015*)
> ...
>    VAR m: LONGINT;
>  BEGIN IF i >= j THEN m := i ELSE m := j END ;
>    RETURN m
>  END Max;"
> Question: If RETURN was discarded and it is now a "no statement", then how can it return the result like the example above? It sounds illogical, does it not?
> Wojtek
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon

More information about the Oberon mailing list