<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>Hi Folks,<br>
<br>
Just tried Smalltalk-80 (actually Apple Smalltalk-80 running in Mini vMac).<br>
1e-3 "printIt" (1/1000)<br>
1e-3 class "printIt" Fraction<br>
1e3 "printIt" 1000<br>
1e3 class "printIt" SmallInteger<br>
<br>
This has always been the behavior in Squeak too.<br>
<br>
Also check these comments from Dan: http://lists.squeakfoundation.org/pipermail/squeak-dev/2000-March/013368.html<br>
<br>
I don't think this is a bug at all.<br>
BTW, Cuis also supports 1r111111111111 = 12 after this :)<br>
<br>
Cheers,<br>
Juan Vuletich<br>
<br>
Quoting Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:</p>
<blockquote style="border-left:2px solid blue;margin-left:2px;padding-left:12px;" type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, Aug 7, 2014 at 9:05 AM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Wed, 6 Aug 2014, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Hi Levente,<br>
<br>
On Wed, Aug 6, 2014 at 11:43 AM, Levente Uzonyi &lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt; wrote:<br>
&nbsp; &nbsp; &nbsp; On Wed, 6 Aug 2014, Eliot Miranda wrote:<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hi All,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Squeak trunk also suffers from the Float parsed as a Fraction bug:<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1e-8 class Fraction<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1.0e8 class Float<br>
<br>
<br>
I'm not entirely sure about it being a bug. I've checked Squeak 3.8 (pre-SqNumberParser), and it also parsed that literal as a Fraction. If I want a Float, I can be explicit and use 1.0e-8.<br>
<br>
<br>
IMO it very much *is* a bug. &nbsp;Smalltalk-80 has never supported Fraction literals. &nbsp;They're always written as division expressions. &nbsp;Fraction answers false to isLiteral. &nbsp;Just because it worked that way<br>
doesn't mean it was right. &nbsp;I suspect no one noticed. &nbsp;Allowing Fraction literals feels like a big change to me.</p>
</blockquote>
</div>
It's more like undefined behavior than a bug IMHO, though the lack of #isLiteral makes me think that the Fractions are not intentional. Interesting how Nicolas's SqNumberParser behaves the same way as the previous number parser in this case.
<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p><br>
&nbsp; &nbsp; &nbsp; I made a modified version of Fraction &gt;&gt; #printOn:base: which outputs the literal format if possible. The change "fixes" the debugger (note that itw was way less broken in Squeak than in Pharo<br>
&nbsp; &nbsp; &nbsp; anyway).<br>
&nbsp; &nbsp; &nbsp; The only drawback I found is that some fractions become a bit more "complex" when printed, e.g. 3/4 =&gt; 75e-2<br>
<br>
<br>
OK, but is this the right fix? &nbsp;What does everybody think? &nbsp;Keep the language unchanged or add Fraction literals and add another incompatibility with other dialects?</p>
</blockquote>
</div>
I don't think that anyone ever used this "feature" before, so doing what other dialects do is probably the best way to resolve this.</blockquote>
<div>&nbsp;</div>
<div>Agreed. &nbsp;Smalltalk-80 v2 had no literal fractions. &nbsp;ObjectWorks and VisualWorks have never had literal fractions. &nbsp;I can't speak for other dialects, but I'm fairly sure none of the Smalltalk/V, Team/V lineage had literal Fractions either.</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>If Fractions are literals<br>
- what is the semantics of 1/0 (easy, it is not a literal, but needs to be stated)?<br>
- what is [1/0.1] on: ZeroDivide do: [:ex| #error] ? &nbsp;Is it 10.0 or #error, i.e. is 1/0.1 10.0 or 1 / 0 followed by the Integer 1?</p>
</blockquote>
</div>
I did not propose to make all fractions literals. My implementation simply prints decimal fractions with the exponent notation, e.g. 3/4 is printed as 75-e2, but 2/3 is still printed as (2/3).<br>
<br>
<br>
<span class="HOEnZb"><font color="#888888">Levente</font></span>
<div class="HOEnZb">
<div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>&nbsp;<br>
&nbsp; &nbsp; &nbsp; Levente<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eek! Eliot<br>
<br>
--<br>
best,Eliot<br>
&nbsp;</p>
</blockquote>
</div>
</div>
<br>
<br>
&nbsp;</blockquote>
</div>
<br>
<br clear="all">
<div>&nbsp;</div>
--<br>
best,
<div>Eliot</div>
</div>
</div>
</blockquote>
<p><br>
<br></p>
</body>
</html>