[Oberon] Negative integer literals in Oberon

Oleg N. Cher allot at bk.ru
Fri May 1 19:16:51 CEST 2020


Jörg пишет:

> In Oberon-07, you can write
>   b := 0FFFFFFFFFFFFH;
>   i := 0FFFFFFFFFFFFH;
> 
> the results are: b = 255 and i = -1.

This is some kind of trash and ugliness. Why is overflow not detected?

The fact that overflow is allowed and it is not caught in any way, 
generates carelessness and lack of accuracy. This was much better done 
in Oberon/Oberon-2. IMHO.

>>
>> So I understand the H/L suffix enables the use of hex bit patterns for 
>> 32 and 64 bit integers, but does not address the issue for 8 or 16 bit 
>> integers.
>>
>> Do you know if there is any way to enable e.g. FF for bytes, or FFFF 
>> for shortints? Or whether this was considered?
>>
>> Thanks --
>>
> 
> ------------------------------------------------------------------------
> 
> --
> 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