<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Seems fine either way.<BR>
Assignability gives us, which we were missing before, VAR a:LONGINT := 0;<BR><BR><BR>
<DIV> > (Yes, I know that the REAL/LONGREAL/EXTENDED literals are all distinct, but they really</DIV>
<DIV> > do have incompatible value representations).</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I keep seeing this and am surprised.</DIV>
<DIV>Isn't it the case that REAL <= LONGREAL <= EXTENDED</DIV>
<DIV>in terms of precision and range?<BR>LONGREAL can losslessly represent all the values that REAL can represent, and possibly more (yes);</DIV>
<DIV>EXTENDED can losslessly representa ll the values that LONGREAL can represent, and possibly more (not);</DIV>
 <BR>
 <BR>
And then, if that is true, mixing should be allowed..widen any constituents<BR>
in an expression to the widest type.<BR>
 <BR>
 <BR>
I realize mixing floating point and integer is less natural, nothing about<BR>
floating point is natural really, though on a 32bit platform<BR>
LONGREAL can hold all INTEGERS..<BR><BR> - Jay<BR><BR> <BR>
<HR id=stopSpelling>
From: hosking@cs.purdue.edu<BR>Date: Sun, 10 Jan 2010 15:23:28 -0500<BR>To: m3devel@elegosoft.com<BR>Subject: [M3devel] Integer literals<BR><BR>
<DIV>One thing I've really struggled with over the introduction of LONGINT is the need for distinct literal forms.  This strikes me as odd, since literals are really just ways of writing values, rather than stating anything about how they should be represented.</DIV>
<DIV>(Yes, I know that the REAL/LONGREAL/EXTENDED literals are all distinct, but they really do have incompatible value representations).</DIV>
<DIV><BR></DIV>
<DIV>It strikes me that with checked assignability for INTEGER/LONGINT we could also potentially treat integer literals as essentially "untyped" (neither INTEGER nor LONGINT). (I still strongly resist going the route of having mixed type operands for arithmetic...)</DIV>
<DIV><BR></DIV>
<DIV>Here's how things would work with subrange types.</DIV>
<DIV><BR></DIV>
<DIV>A subrange written as currently</DIV>
<DIV><BR></DIV>
<DIV><FONT class=ecxApple-style-span size=3 face=Courier><SPAN style="FONT-SIZE: 12px" class=ecxApple-style-span>[lo .. hi]</SPAN></FONT></DIV>
<DIV><BR></DIV>
<DIV>would by default be assumed to have base type INTEGER.  The constants lo/hi must both be in range for INTEGER.</DIV>
<DIV><BR></DIV>
<DIV>A subrange with base type LONGINT would be written explicitly:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV><FONT class=ecxApple-style-span size=3 face=Courier><SPAN style="FONT-SIZE: 12px" class=ecxApple-style-span>[lo .. hi] OF LONGINT</SPAN></FONT></DIV></DIV>
<DIV><BR></DIV>
<DIV>
<DIV>The constants lo/hi must both be in range for LONGINT.</DIV>
<DIV><BR></DIV>
<DIV>We could also support the form:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>
<DIV><FONT class=ecxApple-style-span size=3 face=Courier><SPAN style="FONT-SIZE: 12px" class=ecxApple-style-span>[lo .. hi] OF INTEGER</SPAN></FONT></DIV>
<DIV><FONT class=ecxApple-style-span face=Courier><BR></FONT></DIV></DIV></DIV>
<DIV>just for consistency though the "OF INTEGER" qualification would be unnecessarily verbose.</DIV>
<DIV><BR></DIV>
<DIV>Here we are allowing the programmer to state explicitly what the base type of the subrange should be.</DIV>
<DIV><BR></DIV>
<DIV>Literals would be be range-checked when used as arithmetic operands or in assignment, with compile-time checks that they are in range ("compatible") with the types of the other operands or the destination of the assignment.</DIV></DIV><BR>
<DIV><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV style="WORD-WRAP: break-word"><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV><FONT class=ecxApple-style-span color=#0000ff><FONT class=ecxApple-style-span face="Gill Sans"><SPAN style="FONT-FAMILY: 'Gill Sans'; COLOR: rgb(0,0,255)" class=ecxApple-style-span><SPAN style="FONT-FAMILY: 'Gill Sans'; COLOR: rgb(0,0,255)" class=ecxApple-style-span>Antony Hosking</SPAN></SPAN></FONT></FONT><FONT class=ecxApple-style-span face="Gill Sans"><SPAN style="FONT-FAMILY: 'Gill Sans'" class=ecxApple-style-span><SPAN style="FONT-FAMILY: 'Gill Sans'" class=ecxApple-style-span><SPAN class=ecxApple-converted-space> </SPAN>|<SPAN class=ecxApple-converted-space> </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 'Gill Sans'" class=ecxApple-style-span><SPAN style="FONT-FAMILY: 'Gill Sans'" class=ecxApple-style-span>Associate Professor</SPAN></SPAN><SPAN style="FONT-FAMILY: 'Gill Sans'" class=ecxApple-style-span><SPAN style="FONT-FAMILY: 'Gill Sans'" class=ecxApple-style-span> | Computer Science | Purdue University</SPAN></SPAN></FONT></DIV>
<DIV><FONT class=ecxApple-style-span face=GillSans-Light><SPAN style="FONT-FAMILY: GillSans-Light" class=ecxApple-style-span>305 N. University Street | West Lafayette | IN 47907 | USA</SPAN></FONT></DIV>
<DIV><FONT class=ecxApple-style-span color=#0000ff face="Gill Sans"><SPAN style="FONT-FAMILY: 'Gill Sans'; COLOR: rgb(0,0,255)" class=ecxApple-style-span><SPAN style="FONT-FAMILY: 'Gill Sans'; COLOR: rgb(0,0,255)" class=ecxApple-style-span>Office</SPAN></SPAN></FONT><FONT class=ecxApple-style-span face=GillSans-Light><SPAN style="FONT-FAMILY: GillSans-Light" class=ecxApple-style-span><SPAN style="FONT-FAMILY: GillSans-Light" class=ecxApple-style-span> <?XML:NAMESPACE PREFIX = SKYPE /><SKYPE:SPAN id=softomate_v3_highlight_0 class=skype_v3_tb_injection title=Call this phone number in United States of America with Skype: +17654946001 type=".flex" rtl="1" skypeid="0" skypeaction="call" nof="" isfax="" freecall="" fwidth=".w16" mode=".compat" path="file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/" durex2="%DADDYHEIGHT%" durex="%DADDYWIDTH%" context="+1 765 494 6001"><SKYPE:SPAN id=skype_v3_tb_img_r0 class=skype_v3_tb_imgR></SKYPE:SPAN><SKYPE:SPAN id=skype_v3_tb_text0 class=skype_v3_tb_injectionIn><SKYPE:SPAN id=skype_v3_tb_innerText0 class=skype_v3_tb_innerText> +1 765 494 6001 </SKYPE:SPAN></SKYPE:SPAN><SKYPE:SPAN id=skype_v3_tb_img_s0 class=skype_v3_tb_imgS></SKYPE:SPAN><SKYPE:SPAN style="BACKGROUND-IMAGE: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/inactive_a.compat.flex.w16.gif)" id=skype_v3_tb_droppart_0 class=skype_v3_tb_imgA title="Skype actions" skypeid="0" skypeaction="drop" skypesms="0"><SKYPE:SPAN style="BACKGROUND-IMAGE: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/famfamfam/US.gif)" id=skype_v3_tb_img_f0 class=skype_v3_tb_imgFlag></SKYPE:SPAN></SKYPE:SPAN></SKYPE:SPAN> <SKYPE:SPAN id=softomate_v3_print_0 class=skype_v3_tb_injection_print context="">+1 765 494 6001</SKYPE:SPAN>  |<SPAN class=ecxApple-converted-space> </SPAN></SPAN></SPAN></FONT><FONT class=ecxApple-style-span color=#0000ff face="Gill Sans"><SPAN style="FONT-FAMILY: 'Gill Sans'; COLOR: rgb(0,0,255)" class=ecxApple-style-span><SPAN style="FONT-FAMILY: 'Gill Sans'; COLOR: rgb(0,0,255)" class=ecxApple-style-span>Mobile</SPAN></SPAN></FONT><FONT class=ecxApple-style-span face=GillSans-Light><SPAN style="FONT-FAMILY: GillSans-Light" class=ecxApple-style-span><SPAN style="FONT-FAMILY: GillSans-Light" class=ecxApple-style-span><SPAN class=ecxApple-converted-space> </SPAN><SKYPE:SPAN id=softomate_v3_highlight_1 class=skype_v3_tb_injection title=Call this phone number in United States of America with Skype: +17654275484 type=".flex" skypeid="1" skypeaction="call" nof="" isfax="" freecall="" fwidth=".w16" mode=".compat" path="file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/" durex2="%DADDYHEIGHT%" durex="%DADDYWIDTH%" context="+1 765 427 5484"><SKYPE:SPAN style="BACKGROUND-IMAGE: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/inactive_a.compat.flex.w16.gif)" id=skype_v3_tb_droppart_1 class=skype_v3_tb_imgA title="Skype actions" skypeid="1" skypeaction="drop" skypesms="1"><SKYPE:SPAN style="BACKGROUND-IMAGE: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/famfamfam/US.gif)" id=skype_v3_tb_img_f1 class=skype_v3_tb_imgFlag></SKYPE:SPAN></SKYPE:SPAN><SKYPE:SPAN id=skype_v3_tb_img_s1 class=skype_v3_tb_imgS></SKYPE:SPAN><SKYPE:SPAN id=skype_v3_tb_text1 class=skype_v3_tb_injectionIn><SKYPE:SPAN id=skype_v3_tb_innerText1 class=skype_v3_tb_innerText> +1 765 427 5484 </SKYPE:SPAN></SKYPE:SPAN><SKYPE:SPAN id=skype_v3_tb_img_r1 class=skype_v3_tb_imgR></SKYPE:SPAN></SKYPE:SPAN> <SKYPE:SPAN id=softomate_v3_print_1 class=skype_v3_tb_injection_print context="">+1 765 427 5484</SKYPE:SPAN> </SPAN></SPAN></FONT></DIV>
<DIV><FONT class=ecxApple-style-span face=GillSans-Light><BR class=ecxkhtml-block-placeholder></FONT></DIV></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN><BR class=ecxApple-interchange-newline></SPAN></DIV></SPAN></SPAN><BR class=ecxApple-interchange-newline></DIV><BR>                                           </body>
</html>