<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><span class="Apple-style-span" style="font-size: medium; ">On 7 Jan 2010, at 23:03, <a href="mailto:hendrik@topoi.pooq.com">hendrik@topoi.pooq.com</a> wrote:</span></div></span></span></span></span></span></span></span></span></div></span></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Thu, Jan 07, 2010 at 01:58:51PM -0500, Tony Hosking wrote:<br><blockquote type="cite">I think your confusion relates to understanding how the language <br></blockquote><blockquote type="cite">defines "base" types.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">You should understand that INTEGER and LONGINT have *different* base <br></blockquote><blockquote type="cite">types. This indicates that they have inherently different <br></blockquote><blockquote type="cite">representations,<br></blockquote><br>What's implicit in this statment is that all the subranges of INTEGER <br>have inherently the same representation. Why is this inportant? Are <br>there, for example, places in the language where you have a subrange <br>but don't know what the subrange is?<br></div></blockquote><div><br></div><div>A subrange always has a known base type.</div><br><blockquote type="cite"><div><blockquote type="cite">and indeed, operations on INTEGER and operations on <br></blockquote><blockquote type="cite">LONGINT are inherently different.<br></blockquote><br>So in the language at present, there is no single type at the top of the <br>integer type lattice (and it's not really a lattice). There are, <br>however, two maximal types. Is this right?<br></div></blockquote><div><br></div><div>Correct. Here is the subtype rule for ordinals:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Times; ">For ordinal types <tt>T</tt> and <tt>U</tt>, we have <tt>T <: U</tt> if they have the same base type and every member of <tt>T</tt> is a member of <tt>U</tt>. That is, subtyping on ordinal types reflects the subset relation on the value sets.</span></div><div><br></div>Currently, we have two possible base types for ordinals: INTEGER and LONGINT. They are distinct, unrelated types.</div><div><br><blockquote type="cite"><div><blockquote type="cite">Every enumeration type similarly has a base type. If it's range is <br></blockquote><blockquote type="cite">expressed over INTEGER values then its base type is INTEGER. If <br></blockquote><blockquote type="cite">expressed over LONGINT then its base type is LONGINT.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I don't think I understand the rest of your questions.<br></blockquote><br>Where in the language is it important that INTEGER and LONGINT be <br>different base types? In other words, what advantages does this <br>separation convey?<br></div></blockquote><div><br></div><div>It conveys specific information about what specific machine values and operations implement them. They can (and usually do) require different code to operate on them. From a programmer's perspective, I know that every operation on INTEGER base values will involve *natural* integer arithmetic. For LONGINT I am much less sure, and may require even calling a library to perform the operation (if the machine doesn't naturally support LONGINT).</div><br><blockquote type="cite"><div><br>-- hendrik<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 7 Jan 2010, at 11:46, <a href="mailto:hendrik@topoi.pooq.com">hendrik@topoi.pooq.com</a> wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">I have some questions as to the constraints that need to be placed on <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">integral types. These issues are fundamental to an understanding of the <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">role of LONGINT, INTEGER, and CARDINAL, and what we should be doing <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">about them.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Is there a need for an integer type that can contain all the sizes of <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">integers that can be handled by the language? I'll call it TOP just so <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I can talk about it easily.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">If it is necessary, is TOP only needed to make the language definition <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">clean and concise? Conversely, is it necessary for TOP to be available <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">to programmers? Is it necessary for TOP to be efficiently implemented, <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">or implemented at all?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Even if it is not available directly to programmers, are there language <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">features that require it internally?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Is it necessary that, for every two integer subranges I and J, there <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">exist an integer range K such that both I and J are subranges of K?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The most commonly used integral type is INTEGER. It seems to be the <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">type used by programmers by default when they don't want to think of <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the specific range they will need. But is it necessary for the type <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">called INTEGER to be TOP? Or, is there is no maximum implemented <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">integral type, is it still necessary for INTEGER to be a maximal <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">integral type?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-- hendrik<br></blockquote></blockquote><blockquote type="cite"><br></blockquote></div></blockquote></div><br></body></html>