[Oberon] Easter eggs in Oberon

Chris Burrows chris at cfbsoftware.com
Tue Apr 14 00:28:04 CEST 2020


> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
Skulski,
> Wojciech
> Sent: Tuesday, 14 April 2020 7:06 AM
> To: ETH Oberon and related systems
> Subject: Re: [Oberon] Easter eggs in Oberon
> 
> Joerg:
> >you could apply this to BYTE: if the result is not in the range 0..255 it
> just wraps around or overflows or underflows, but is not undefined.
> 
> Perhaps the term should not be "undefined", but rather "unspecified".

How would that be different?

> 
> I would ask, why do we need BYTE as an integer subtype (or integer
subrange)?
> Why do we need math on BYTE values? BYTE math is implemented with 32-bit
> integer math. So why not use the full INTEGER for calculations? If you
need
> to sub-range an integer to (0..255), use MOD.
> 

Possibly. However, to be consistent we would then need to have WORD instead
of INTEGER to cater for values that did not represent numeric quantities.
That language experiment was conducted in Modula-2 but proved to be too
cumbersome in practice when used over a period of 10+ years.

> VAR b: BYTE;
> b := 255; b := b+1; (* now b = 0; what we "somehow know" even though
> unspecified *)
> 

Don't assume that is so unless you like surprises.

Regards,
Chris




More information about the Oberon mailing list