[M3devel] longint..revisited?

Jay K jay.krell at cornell.edu
Fri Jan 8 04:35:44 CET 2010


I can't find Rodney's proposal but I think I understand
a lot of it from today's mail.


Can we revisit this?


My understanding is that Rodney's proposal
deems INTEGER assignable to LONGINT,
and vice versa, and that assignments of LONGINT
to INTEGER undergo runtime range checks,
can raise exceptions.


I assume it also follows that:


LONGINT can be added/subtracted/modded to INTEGER,
yielding LONGINT.


INTEGER MOD LONGINT would range check the LONGINT.


INC/DEC(LONGINT, INTEGER) would just work


INC/DEC(INTEGER, LONGINT) would range check.


The downside is that the chance for failure would be
silently injected into various places.


Another proposal would be that INTEGER is assignable to LONGINT,
but not vice versa. I really don't see why not.


   LONGINT := INTEGER  
   LONGINT + INTEGER => LONGINT  
  


LONGINT - INTEGER => LONGINT  
  


LONGINT * INTEGER => LONGINT  
   LONGINT / INTEGER => LONGINT  
  
LONGINT MOD INTEGER => INTEGER (think about it) 
   INC(LONGINT, INTEGER)
  

DEC(LONGINT, INTEGER)





all seem very reasonable.


 - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100108/50e11a68/attachment-0001.html>


More information about the M3devel mailing list