[Oberon] LONGINT, RETURN & etc.

Jörg joerg.straube at iaeth.ch
Fri Jun 9 16:09:27 CEST 2017


Hi

Officially, the type "LONGINT" does not exist anymore. However, the compiler
tolerates to use "LONGINT". Internally, it's equivalent to "INTEGER".

"RETURN" does exist to return the value of the function. Syntactically it's
no statement anymore (statements can be written anywhere in a function
body), but it is a reserved word now that has to be used just before the
"END" of a function.
As it's no statement anymore, you don't need to add a ";" before "RETURN"

I indent the RETURN now on the same level as END, but this is my personal
preference...

br
Jörg


-----Original Message-----
From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
peter at easthope.ca
Sent: Freitag, 9. Juni 2017 15:58
To: oberon at lists.inf.ethz.ch
Subject: [Oberon] LONGINT, RETURN & etc.

In pages 5 and 6 of _Project Oberon_, Revised Edition 2013, 
Prof. Wirth states, 
"1. The data types LONGINT, ... have been discarded, ...
  ...
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;"

Wirth's revisions of syntax not yet implemented?

Thanks,          ... Lyall E.
 
-- 

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202                      Pender Is.: +1 250 629 3757
http://easthope.ca/Peter.html              Bcc: peter at easthope. ca

--
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