[M3devel] cm3 regression

Olaf Wagner wagner at elegosoft.com
Wed Apr 16 12:47:58 CEST 2008


Quoting Jay <jayk123 at hotmail.com>:

> [tangential...]
>
> I think the definition of INTEGER is OK, but it'd be nice imho for   
> the language or m3core to also build-in UINTEGER, INT8, INT16,   
> INT32, INT64, UINT8, UINT16, UINT32, UINT64, just so folks wouldn't   
> have to provide them themselves. (CARDINAL I don't think is what I   
> want.)
> Add them somewhere in m3core?
> MODULE Integers; ?

Such things may be convenient for programmers, but are left out of the
language because the specification must not become too long, I think.
I'd opt for library extensions in this case.

> Unfortunately, actually, I want more than this, and then coming up   
> with names is hard.
>
> I know you can often push stuff out of the language and into a   
> library. As long as the language allows the library writer to   
> provide a "nice enough" interface. For example the use of the plus   
> sign on user defined types.. You know..like C++... but less   
> complicated and easier to implement and fully understand...

Ah, operator overloading opens up another of Pandora's boxes,
I think. It will dramatically increase the complexity of the
language.

> In C, "officially", unsigned integers are unsafe and wrap around   
> silently, and overflow on signed integers is undefined, however in   
> reality, they are also silent, and I suspect, but am not sure, that   
> I want both versions..maybe only for compat with existing code.
>
> Which reminds me -- am I correct that the Modula-3 language defines   
> overflow as raising an exception but nobody implements it that way?   
> I can check. Are folks interested in fixing that?

Yes, IIRC there are no checks on integer overflow; this is an
implementation flaw. How would you provide this? Add generation of
checks on every integer operation?

Olaf
-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list