<html><head><base href="x-msg://1270/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><span class="Apple-style-span" style="font-size: medium;"><font class="Apple-style-span" color="#0000FF" face="'Gill Sans'">No! You're missing my whole point about representation. With what you are proposing here for the float types you will end up with implicit conversion operations performed in the hardware. The whole idea with explicit conversions is that programmers don't end up coding something that they have not transparently written. That is a fundamental and highly-valued design principle with Modula-3. We are not trying to reinvent C here.</font></span></div></span></span></span></span></span></span></span></span></div></span></span>
</div>
<br><div><div>On 10 Jan 2010, at 15:43, Jay K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">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:<span class="Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Sun, 10 Jan 2010 15:23:28 -0500<br>To:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><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 class="ecxApple-style-span" style="font-size: 12px; ">[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 class="ecxApple-style-span" style="font-size: 12px; ">[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 class="ecxApple-style-span" style="font-size: 12px; ">[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 class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><div style="word-wrap: break-word; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><div><font class="ecxApple-style-span" color="#0000ff"><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); ">Antony Hosking</span></span></font></font><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-converted-space"> </span>|<span class="ecxApple-converted-space"> </span></span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); ">Office</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light; "><span class="ecxApple-style-span" style="font-family: GillSans-Light; "> <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 id="skype_v3_tb_droppart_0" class="skype_v3_tb_imgA" title="Skype actions" skypeid="0" skypeaction="drop" skypesms="0" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/inactive_a.compat.flex.w16.gif); "><skype:span id="skype_v3_tb_img_f0" class="skype_v3_tb_imgFlag" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/famfamfam/US.gif); "></skype:span></skype:span></skype:span><span class="Apple-converted-space"> </span><skype:span id="softomate_v3_print_0" class="skype_v3_tb_injection_print" context="">+1 765 494 6001</skype:span><span class="Apple-converted-space"> </span>|<span class="ecxApple-converted-space"> </span></span></span></font><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); ">Mobile</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light; "><span class="ecxApple-style-span" style="font-family: GillSans-Light; "><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 id="skype_v3_tb_droppart_1" class="skype_v3_tb_imgA" title="Skype actions" skypeid="1" skypeaction="drop" skypesms="1" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/inactive_a.compat.flex.w16.gif); "><skype:span id="skype_v3_tb_img_f1" class="skype_v3_tb_imgFlag" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/famfamfam/US.gif); "></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><span class="Apple-converted-space"> </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></div></span><br class="Apple-interchange-newline"></blockquote></div><br></body></html>