[Oberon] Texts.WriteInt
Chris Burrows
chris at cfbsoftware.com
Sat Mar 29 02:02:47 CET 2014
> -----Original Message-----
> From: Douglas G. Danforth [mailto:danforth at greenwoodfarm.com]
> Sent: Saturday, 29 March 2014 11:10 AM
> To: paulreed at paddedcell.com; ETH Oberon and related systems
> Subject: Re: [Oberon] Texts.WriteInt
>
>
> On 3/28/2014 11:45 AM, Paul Reed wrote:
> > Dear all,
> >
> >>> IF ROR(x, 31) = 1 ...
> > ...
> >> IF x = {31} ...
> > But x is not a SET, it's an INTEGER.
> IF BITS(x) = {31} ...
>
BITS is an extension to Oberon that is defined in Component Pascal. It is
not defined in the 2013 Oberon Language Report or implemented in RISC
Oberon. However, we have also implemented it as an extension to Oberon in
the Astrobe Oberon compiler.
For RISC Oberon the equivalent is:
IF SYSTEM.VAL(SET, x) = {31} THEN ...
Based on the fact that it is currently valid to use ORD to convert a SET to
an INTEGER I would like to see a standard function (e.g. BITS) defined in a
future Oberon Language Report that enabled you to do the converse (i.e.
convert an INTEGER to a SET) without have to import SYSTEM,
Regards,
Chris
Chris Burrows
CFB Software
http://www.astrobe.com
More information about the Oberon
mailing list