<div dir="ltr">Hi Juan,<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 7, 2014 at 9:40 AM, J. Vuletich (mail lists) <span dir="ltr">&lt;<a href="mailto:juanlists@jvuletich.org" target="_blank">juanlists@jvuletich.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>





<div 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 &quot;printIt&quot; (1/1000)<br>
1e-3 class &quot;printIt&quot; Fraction<br>
1e3 &quot;printIt&quot; 1000<br>
1e3 class &quot;printIt&quot; SmallInteger<br>
<br>
This has always been the behavior in Squeak too.<br></p></div></blockquote><div><br></div><div>What happens if you try compiling a method containing a literal Fraction and both debug it and decompile it. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-family:Arial;font-size:14px"><p>Also check these comments from Dan: <a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2000-March/013368.html" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2000-March/013368.html</a></p>
</div></blockquote><div><br></div><div>Dan doesn&#39;t say anything about Fraction literals in this message.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-family:Arial;font-size:14px"><p>I don&#39;t think this is a bug at all.<br></p></div></blockquote><div><br></div><div>What, that 1e-3 is a Fraction, not a Float?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-family:Arial;font-size:14px"><p>
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" target="_blank">eliot.miranda@gmail.com</a>&gt;:</p><div><div class="h5">
<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>
      On Wed, 6 Aug 2014, Eliot Miranda wrote:<br>
<br>
            Hi All,<br>
                Squeak trunk also suffers from the Float parsed as a Fraction bug:<br>
<br>
            1e-8 class Fraction<br>
            1.0e8 class Float<br>
<br>
<br>
I&#39;m not entirely sure about it being a bug. I&#39;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.  Smalltalk-80 has never supported Fraction literals.  They&#39;re always written as division expressions.  Fraction answers false to isLiteral.  Just because it worked that way<br>
doesn&#39;t mean it was right.  I suspect no one noticed.  Allowing Fraction literals feels like a big change to me.</p>
</blockquote>
</div>
It&#39;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&#39;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>
      I made a modified version of Fraction &gt;&gt; #printOn:base: which outputs the literal format if possible. The change &quot;fixes&quot; the debugger (note that itw was way less broken in Squeak than in Pharo<br>
      anyway).<br>
      The only drawback I found is that some fractions become a bit more &quot;complex&quot; when printed, e.g. 3/4 =&gt; 75e-2<br>
<br>
<br>
OK, but is this the right fix?  What does everybody think?  Keep the language unchanged or add Fraction literals and add another incompatibility with other dialects?</p>
</blockquote>
</div>
I don&#39;t think that anyone ever used this &quot;feature&quot; before, so doing what other dialects do is probably the best way to resolve this.</blockquote>
<div> </div>
<div>Agreed.  Smalltalk-80 v2 had no literal fractions.  ObjectWorks and VisualWorks have never had literal fractions.  I can&#39;t speak for other dialects, but I&#39;m fairly sure none of the Smalltalk/V, Team/V lineage had literal Fractions either.</div>

<div> </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] ?  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><font color="#888888">Levente</font></span>
<div>
<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p> <br>
      Levente<br>
            --<br>
            eek! Eliot<br>
<br>
--<br>
best,Eliot<br>
 </p>
</blockquote>
</div>
</div>
<br>
<br>
 </blockquote>
</div>
<br>
<br clear="all">
<div> </div>
--<br>
best,
<div>Eliot</div>
</div>
</div>
</blockquote>
<p><br>
<br></p>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>