[Oberon] OBNC Sets incorrect output

Joe Turner medianjoe at mailfence.com
Sun Mar 20 16:44:40 CET 2022


Hi Diego,

Thanks. I just assumed that if using long type I would be able to use SET up to 63, but it seems it's not the case.
Not sure if it's what the author intended or not. I don't need sets with more than 64 elements, but more than 32, so it would have been handy. Anyway, I'll look around for a library, or I guess it wouldn't be too hard to write one myself using an array of boolean.

March 20, 2022 4:01:34 PM CET Diego Sardina <dsar at eml.cc> wrote:On Sun, Mar 20, 2022, at 1:03 PM, Joe Turner wrote:
> 
> Sorry, I don't understand your point. I know that the set size is 32 {0..31}
but if if OBNC is built with --c-int-type=long it should be 64 {0..63}. So why
is my code not giving the correct output for sets which contain elements > 31?
> 

I don't use that compiler but I  guess it's a bug of OBNC and you should
contact the author.

The SET type is a special one and it's not enough to change the underlying type
to support 64 bit values because there are also SET constants like {0, 1, 4 ..
7}. This means also the code generator should be adapted to support 64 bit SET
(and it's a non trivial change).

If you switched to long type just for the SET type, it's better that you use a
library (based on SET).

--
Diego Sardina

--
Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
https://lists.inf.ethz.ch/mailman/listinfo/oberon

-- Sent with https://mailfence.com  Secure and private email
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20220320/1eb4b10a/attachment.html>


More information about the Oberon mailing list