[Oberon] ORD and scalar types

Jörg joerg.straube at iaeth.ch
Wed Mar 7 15:58:23 CET 2018


August

Compiler sometimes include "enhancements" you may use (e.g. LONGINT in
PO2013), but if you use them, your code is not portable anymore and is not
guaranteed to be supported in the future.

If you want to be on the safe side replace ORD() with SYSTEM.VAL(INTEGER,
...).
Then you at least know (as you import SYSTEM) that it's not portable
anymore.

Jörg

-----Original Message-----
From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of August
Karlstrom
Sent: Wednesday, March 07, 2018 3:02 PM
To: ETH Oberon and related systems <oberon at lists.inf.ethz.ch>
Subject: [Oberon] ORD and scalar types

According to the Oberon-07 language report, the procedure ORD accepts 
parameters of type CHAR, BOOLEAN and SET. In Project Oberon 2013, 
however, ORD accepts parameters of any scalar type; even NIL. The 
procedure Texts.WriteReal, for instance, uses ORD(x) for the real number 
x. Is this to be considered a language extension?


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