<html><head><base href="x-msg://1834/"></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 16 Dec 2009, at 19:52, Jay K wrote:</span></div></span></span></span></span></span></span></span></span></div></span></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">"0..LAST(LONGINT)" having varying meaning...like when INTEGER is > 64 bits, then LONGINT=INTEGER, and we anticipate 128 bit INTEGER?<br> <br> <br>See..LONGINT is only useful in this brief period where we still have 32bit INTEGER.<br>(Actually it would have been useful long ago.)<br></div></span></blockquote><div><br></div><div>LONGINT could be 128 bits for all its definition cares. It is just something usually (not always) bigger than an INTEGER.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; "> I really think "long" is a dumb name..<br>There should be INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, and unsigned and signed integers the same size of a pointer, possibly called INT and UINT, or size_t and ptrdiff_t..<br></div></span></blockquote><div><br></div><div>Now these are dumb names because they wire in the size of the value.</div><div><br></div><div>In Modula-3 INTEGER is a natural (i.e., word-size) value.</div><div><br></div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; "> <br> <br> - Jay<br><br> <br>> Date: Wed, 16 Dec 2009 16:56:55 -0600<br>> From:<span class="Apple-converted-space"> </span><a href="mailto:rodney_bates@lcwb.coop">rodney_bates@lcwb.coop</a><br>> To:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>> Subject: Re: [M3devel] Oops, forgot to ask<br>><span class="Apple-converted-space"> </span><br>> Tony Hosking wrote:<br>> > On 16 Dec 2009, at 15:48, Peter Eiserloh wrote:<br>> ><br>> ><span class="Apple-converted-space"> </span><br>> >> Hi Gang,<br>> >><br>> >> 0 - CARDINALs are an integral type defined by the language<br>> >> spec to be from 0 (zero) to MAXINT (not MAXCARD). Recently,<br>> >> a change was made to CM3 to extend the language it recognizes<br>> >> beyond the original language spec (SPWM3), now CM3 understands<br>> >> a LONGINT.<span class="Apple-converted-space"> </span><br>> >><br>> >> Was there a corresponding LONGCARD defined?<br>> >><span class="Apple-converted-space"> </span><br>> ><br>> > No. But you can write:<br>> ><br>> > [0L..LAST(LONGINT)]<br>> ><br>> > just as<br>> ><br>> > CARDINAL=[0..LAST(INTEGER)]<br>> ><span class="Apple-converted-space"> </span><br>> Actually, the line above was once true, long long ago, when dinosaurs<br>> roamed unfettered. CARDINAL was changed to be "just like"<br>> (but not equal to) [0..LAST(INTEGER)]. This would have been<br>> maybe early 1990s.<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> It took me years to figure out what this actually meant, and more<br>> years to figure out why, but I believe I now know. CARDINAL is not an<br>> equal type to [0..LAST(INTEGER)], but otherwise has all the same<br>> properties. This makes the two mutually assignable, which is close<br>> enough to equal to not matter in most contexts. The exact consequences<br>> follow from other language rules.<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> The motivation is this: [0..LAST(INTEGER)] on a 32-bit machine is not<br>> equal to [0..LAST(INTEGER)] on a 64-bit machine (or any combination of<br>> machines with different values of LAST(INTEGER)), because the numeric<br>> value of LAST(INTEGER) is part of the expanded type. The one place this<br>> matters is if you use pickles to transfer data between machines of different<br>> word sizes. If the type is [0..LAST(INTEGER)], the type signature (a hash<br>> of the complete, expanded type definition) is different on the two machines,<br>> and values of or containing this type cannot be transferred. Exact type<br>> signature matches are used in pickles to find corresponding types when<br>> reading.<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> But pickles handle different sized INTEGER values fine, expanding/shortening<br>> as needed. Being a leaf in a type definition, INTEGER is always the same<br>> type on any machine. So CARDINAL was changed to be its own unique<br>> type too, so it would be possible also to transfer CARDINAL values in<span class="Apple-converted-space"> </span><br>> pickles<br>> between different word sizes.<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> So, we really should have a LONGCARD, parallel to CARDINAL.<br>><span class="Apple-converted-space"> </span><br>> Note that this also affects network objects, which use pickles to transfer<br>> values of the objects.<br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> ><br>> ><span class="Apple-converted-space"> </span><br>> >> Can is use all 64-bits, or is it restricted to 63, like<br>> >> the CARDINAL is only 31-bits.<br>> >><span class="Apple-converted-space"> </span><br>> ><br>> > 63 bits, since its underlying base type is LONGINT.<br>> ><br>> ><br>> ><span class="Apple-converted-space"> </span><br>> >><br>> >><br>> >><br>> >> +--------------------------------------------------------+<br>> >> | Peter P. Eiserloh |<br>> >> +--------------------------------------------------------+<br>> >><br>> >><br>> >><br>> >><span class="Apple-converted-space"> </span><br>> ><br>> ><br>> ><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br></div></span></blockquote></div><br></body></html>