[M3devel] Oops, forgot to ask

Daniel Alejandro Benavides D. dabenavidesd at yahoo.es
Wed Dec 16 22:47:41 CET 2009


Hi Peter and all:
I know think MAX(CARDINAL) should be of value 2^31 - 1 in 32 bits platforms.. There is no LONGCARD. If you want to perform unsigned arithmetic operations you can use WORD an you will have 2^32 values or 2^64 in 32 and 64 bits platform correspondent. 
Concerning INTEGER historically has been 32 bits in 32 bits word size platforms and (by now) 64 bits in 64 bits platforms. LONGINT is tought to be 64 bit in supported platforms (NT386 integrated backend doesn't have it yet). So that 
Another note about historical type changes I could add is that Math interface to C native library its function return types were once REAL but now are LONGREAL. You can convert LONGREAL to REAL values doing FLOAT(Math.Degree, REAL) for code expecting REAL values;

I know WIDECHAR is an additional representation of TEXT in such a case you want to pop WIDECHAR values you will get it from Text interface, all supported platforms have it, I guess the intended use is related to interface native C types and besides the UTF-8 Java Virtual Machine standard internal codification (Modula-3 doesn't enforce that, so there could be an implementation with such encoding I think, said that, so far now, CM3 is not UTF-8 coded as I know)

What I understood about having BRANDED REF is to allow C (calloc) capability of having REF values dynamically allocated in stack memory, allowing speed up in programs that use that (calloc C correspondent). I don't about how does affect type system tough, I mean following Modula-3 BRANDED OBJECT type objects have nominal type equivalence (different from default structural type equivalence) it should be the same for BRANDED REF

I think thats all I know for know, hope it helps 

 
--- El mié, 16/12/09, Peter Eiserloh <eiserlohpp at yahoo.com> escribió:

> De: Peter Eiserloh <eiserlohpp at yahoo.com>
> Asunto: [M3devel] Oops, forgot to ask
> Para: "M3Devel" <m3devel at elegosoft.com>
> Fecha: miércoles, 16 de diciembre, 2009 15:48
> Hi Gang,
> 
> 0 - CARDINALs are an integral type defined by the language
> spec to be from 0 (zero) to MAXINT (not MAXCARD). 
> Recently,
> a change was made to CM3 to extend the language it
> recognizes
> beyond the original language spec (SPWM3), now CM3
> understands
> a LONGINT.  
> 
> Was there a corresponding LONGCARD defined?
> Can is use all 64-bits, or is it restricted to 63, like
> the CARDINAL is only 31-bits.
> 
> 
> 1 - How does one write a WIDECHAR literal?  Are
> WIDECHAR
> currently only 16-bits?  If so they are limited to
> only 
> the basic multilingual plane (BMP).  Unicode
> characters 
> are 20-bits, which is why encodings such as USC-32 exist.
> If a WIDECHAR is only 16-bits, are they encoded as UTF-16,
> which is a similar scheme to UTF-8?  If they are
> currently
> only 16-bits, are there plans to expand it to fully support
> 
> unicode character encodings?
> 
> 
> 2 - Recently there was discussion about creating a new
> type, 
> that is halfway a REFANY, and halfway a value itself. 
> I 
> myself dislike unions, and fortran equivalences, and any 
> other aliasing techniques, but if the compiler supports it,
> 
> we should document it.
> 
> What was it finally called?
> How does one declare an item of this type?
> How does one use it?
> 
> 
> 
> 
> 
> +--------------------------------------------------------+
> | Peter P. Eiserloh         
>                
>             |
> +--------------------------------------------------------+
> 
> 
>       
> 


      




More information about the M3devel mailing list