[M3devel] [Fwd: Re: A nonnative 64-bit language proposal]

Rodney M. Bates rodney.bates at wichita.edu
Fri Jul 20 00:04:14 CEST 2007



Tony Hosking wrote:
> On Jul 19, 2007, at 4:33 PM, Darko wrote:
> 
>> I actually favour a implicit conversion, which for this particular  
>> case I think would be consistent with existing M3 behaviour.
> 
> 
> There is no implicit conversion for floats.  The danger with implicit  
> conversion for integers is that it would not be portable: you would  get 
> different behavior on different machines for the same code.   Better to 
> make the conversion explicit so that programmers are  prepared for the 
> range check to fail.

But is this argument any stronger for requiring explicit conversions
for INTEGER/LONGINT assignments than for assigning to subranges?
Many assignments in the language now, without any type conversion,
admit the possibility of RT range errors.  And these can be dependent
on the size of INTEGER too.  Consider:

   VAR V : [ 0 .. 65535 ] ;
   VAR I : CARDINAL ;
   ...
   V := I DIV 2 ;

I think for portability, the principle that the static semantics should be
the same for all sizes of INTEGER (and LONGINT too) is as much as we can
hope for.  Certainly, there are already countless ways the integer size can
change the dynamic semantics of a program.


-- 
-------------------------------------------------------------
Rodney M. Bates, retired assistant professor
Dept. of Computer Science, Wichita State University
Wichita, KS 67260-0083
316-978-3922
rodney.bates at wichita.edu



More information about the M3devel mailing list