[M3devel] Integers
Tony Hosking
hosking at cs.purdue.edu
Thu Jan 7 19:58:51 CET 2010
I think your confusion relates to understanding how the language defines "base" types.
You should understand that INTEGER and LONGINT have *different* base types. This indicates that they have inherently different representations, and indeed, operations on INTEGER and operations on LONGINT are inherently different.
Every enumeration type similarly has a base type. If it's range is expressed over INTEGER values then its base type is INTEGER. If expressed over LONGINT then its base type is LONGINT.
I don't think I understand the rest of your questions.
On 7 Jan 2010, at 11:46, hendrik at topoi.pooq.com wrote:
> I have some questions as to the constraints that need to be placed on
> integral types. These issues are fundamental to an understanding of the
> role of LONGINT, INTEGER, and CARDINAL, and what we should be doing
> about them.
>
> Is there a need for an integer type that can contain all the sizes of
> integers that can be handled by the language? I'll call it TOP just so
> I can talk about it easily.
>
> If it is necessary, is TOP only needed to make the language definition
> clean and concise? Conversely, is it necessary for TOP to be available
> to programmers? Is it necessary for TOP to be efficiently implemented,
> or implemented at all?
>
> Even if it is not available directly to programmers, are there language
> features that require it internally?
>
> Is it necessary that, for every two integer subranges I and J, there
> exist an integer range K such that both I and J are subranges of K?
>
> The most commonly used integral type is INTEGER. It seems to be the
> type used by programmers by default when they don't want to think of
> the specific range they will need. But is it necessary for the type
> called INTEGER to be TOP? Or, is there is no maximum implemented
> integral type, is it still necessary for INTEGER to be a maximal
> integral type?
>
> -- hendrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100107/747bbe2e/attachment-0002.html>
More information about the M3devel
mailing list