[M3devel] what to do about file sizes being 32bits?

Rodney M. Bates rodney_bates at lcwb.coop
Fri Jan 8 02:22:00 CET 2010


Full-range unsigned integers are a language designer's headache, because
there are conflicts no matter what you do.  The Modula-3 approach is to
use the operations in interface Word.i3 (and now Long.i3) on type
INTEGER (not CARDINAL, which has only half the range).  These apply
unsigned interpretation to values of type INTEGER.

hendrik at topoi.pooq.com wrote:
> On Thu, Jan 07, 2010 at 06:59:31AM +0000, Jay K wrote:
>> File.i3:
>>
>>
>>   Status = RECORD
>>     type: Type;
>>     modificationTime: Time.T;
>>     size: CARDINAL (* oops... *)
>>   END;
>>
>>
>> What to do?
>> [0.. higher than 7FFFFFFF] doesn't "just work".
>>    higher than 7FFFFFFFF is not legal on 32bit, unless you put "L" on the end,
>>    which presumably has some relationship to turning it into a LONGINT, which
>>    causes users to fail to compile
> 
> In any case, is the proper type for file offsets [0..7fffffffffffffff] 
> or [0..ffffffffffffffff]?  I suspect the latter.  It might take some 
> effort to make that legal in Modula 3.
> 
> -- hendrik
> 



More information about the M3devel mailing list