[Oberon] LONGINT, RETURN & etc.

eas lab lab.eas at gmail.com
Sat Jun 17 01:50:16 CEST 2017


>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 explanation help?

Yes.
And it confirms how natural-language explanations are inferior to eg.
syntax diagrams.




On 6/9/17, Jörg <joerg.straube at iaeth.ch> wrote:
> Wojtek
>
> 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?
>
> Jörg
>
>> 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*)
>> ...
>>  PROCEDURE Max(i, j: LONGINT): LONGINT;
>>    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
>
> --
> 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