<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>
<br><div><div>On 17 Apr 2010, at 22:40, Tony Hosking wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On 17 Apr 2010, at 22:35, Mika Nystrom wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Ok, sorry if I am beating a dead horse here.<br><br>What is INTEGER on a 64-bit machine? <br></div></blockquote><div><br></div><div>The language spec doesn't say, but CM3 pretty strongly assumes BITSIZE(INTEGER)=BITSIZE(ADDRESS).</div><div>So, that means 64 bits.</div><br><blockquote type="cite"><div>Modula-3 doesn't specify it to be one or the other does it?<br>But normally, 64 bits?<br><br>I am asking because I was looking through some stub generator code,<br>and I'm really wondering about the LONGINT.  Now there are "longcard"<br>things showing up, which means another set of changes to a lot of code.<br><br>The rationale for LONGINT is, again?<br></div></blockquote><div><br></div><div>Yes, LONGINT is to permit longer than "efficient" INTEGER.  Mainly for 32 bit machines where we'd like to have a C "long long" equivalent.</div><br><blockquote type="cite"><div>We need it to match 64-bit integers on 32-bit machines?  That seems like<br>a very weak rationale indeed, if the same functionality could be provided<br>through some other mechanism (e.g., ARRAY [0..1] OF INTEGER---even with<br>a pragma e.g. <*CLONGLONG*>.. if it is necessary to tell the compiler that<br>a special linkage convention is needed).<br></div></blockquote><div><br></div><div>There's no special linkage convention.  Not sure what you mean here.</div><br><blockquote type="cite"><div>On a 64-bit machine INTEGER and CARDINAL are 64/63 bits (right?), so<br>there is really no need for LONGINT there.<br></div></blockquote><div><br></div><div>True.  The only expectation is BITSIZE(LONGINT) >= BITSIZE(INTEGER).</div><br><blockquote type="cite"><div>And having an array with a LONGINT index seems silly since you can't<br>address more memory than you can fit in an INTEGER anyhow...<br></div></blockquote><div><br></div><div>We don't allow arrays with LONGINT indexes in the current implementation.</div></div></div></blockquote><div><br></div><div>Correction.  We do allow arrays with LONGINT subrange indexes, but the restriction is that NUMBER be representable as an INTEGER.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div><blockquote type="cite"><div><font class="Apple-style-span"><br></font>    Mika<br><br><blockquote type="cite">________________________________<br></blockquote><blockquote type="cite">From: <a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br></blockquote><blockquote type="cite">Date: Thu, 15 Apr 2010 12:55:52 -0400<br></blockquote><blockquote type="cite">To: <a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br></blockquote><blockquote type="cite">CC: <a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br></blockquote><blockquote type="cite">Subject: Re: [M3devel] Modula-3/C interop in Date/Time?<br></blockquote><blockquote type="cite">Excepting that INTEGER is not the same as int on 64-bit platforms.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Antony Hosking | Associate Professor | Computer Science | Purdue University<br></blockquote><blockquote type="cite">305 N. University Street | West Lafayette | IN 47907 | USA<br></blockquote><blockquote type="cite">Office +1 765 494 6001 | Mobile +1 765 427 5484<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 15 Apr 2010, at 02:45, Jay K wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Is this legal/correct?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Date.i3:<br></blockquote><blockquote type="cite">TYPE TimeZone <: REFANY;<br></blockquote><blockquote type="cite">VAR Local, UTC: TimeZone; (* granted, will maybe change these to extern *)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Date.m3:=1B$B!!=1B(B<br></blockquote><blockquote type="cite">REVEAL TimeZone =3D BRANDED "Date.TimeZone" REF INTEGER;<br></blockquote><blockquote type="cite">=1B$B!!=1B(B<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">DatePosixC.c:<br></blockquote><blockquote type="cite">static const int Local =3D 0;<br></blockquote><blockquote type="cite">static const int UTC =3D 1;<br></blockquote><blockquote type="cite">extern const int const * const Date__Local =3D &Local;<br></blockquote><blockquote type="cite">extern const int const * const Date__UTC =3D &UTC;<br></blockquote><blockquote type="cite">=1B$B!!=1B(B<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- Jay<br></blockquote></div></blockquote></div><br></div></blockquote></div><br></body></html>