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

Jay K jay.krell at cornell.edu
Fri Jan 8 02:58:33 CET 2010


I don't believe currently "10" is assignable

(or comparable) to LONGINT.

You have to use 10L.

 

 

I do believe any INTEGER or CARDINAL expression should be assignable

to LONGINT, but I don't think it is implemented that way currently.

 

 

And, then, I wonder if subranges are all we need, no LONGINT.

But I don't understand the language well enough.

 

 

 - Jay

 
> Date: Thu, 7 Jan 2010 19:37:39 -0600
> From: rodney_bates at lcwb.coop
> To: m3devel at elegosoft.com
> Subject: Re: [M3devel] what to do about file sizes being 32bits?
> 
> 
> 
> Tony Hosking wrote:
> > On 7 Jan 2010, at 06:22, Jay K wrote:
> > 
> >> I'm working on this..
> >> Attached is what I have so far.
> >> Posix needs work.
> >> Most code continues to not work for files >4GB on 32bit, but it is a 
> >> start.
> >> It seems to me I shouldn't have o use VAL(i, LONGINT) to convert an 
> >> INTEGER to a LONGINT, as all INTEGER values fit.
> >> Similarly I should be able to compare a LONGINT to 0 directly, instead 
> >> of 0L.
> > 
> > Again, I discourage this as not in the spirit of the Modula-3 type 
> > system which abhors implicit casts.
> > 
> Indeed, Modula-3 has no implicit casts at all. But it does have something
> that sometimes accomplishes the same result in a way that is far simpler
> to define and represents a higher level of abstraction, namely, the
> concept of assignability. A value, e.g. 10, can be in the value set of
> many types (INTEGER, many of its subranges, and now LONGINT and many if
> its subranges too). If so, it can in certain carefully specified cases,
> be assigned from one of these types to another, without any syntactically
> explicit notation required of the programmer.
> 
> This represents the more abstract view that 10 is 10, as opposed to the
> usual view that 10 sitting in a byte is not the same as 10 in a word.
> Of course, at the machine level. they are not the same, but in Modula-3,
> that is only a representation matter that the compiler must take care of,
> not a high-level language matter that needs pages of rules to define.
> 
> It took me years to fully understand the implications of replacing implicit
> type conversions by the assignability concept, but I now consider it one
> of Modula-3's great ideas, even if it is a small thing.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100108/3f0be214/attachment-0002.html>


More information about the M3devel mailing list