[squeak-dev] Float parsed as a Fraction bug

Eliot Miranda eliot.miranda at gmail.com
Thu Aug 7 19:22:38 UTC 2014


On Thu, Aug 7, 2014 at 12:03 PM, J. Vuletich (mail lists) <
juanlists at jvuletich.org> wrote:

>  Hi Eliot,
>
>
> Quoting Eliot Miranda <eliot.miranda at gmail.com>:
>
>  Hi Juan,
>>
>>     On Thu, Aug 7, 2014 at 9:40 AM, J. Vuletich (mail lists)
>> <juanlists at jvuletich.org> wrote:
>>
>>  Hi Folks,
>>>
>>> Just tried Smalltalk-80 (actually Apple Smalltalk-80 running in Mini
>>> vMac).
>>> 1e-3 "printIt" (1/1000)
>>> 1e-3 class "printIt" Fraction
>>> 1e3 "printIt" 1000
>>> 1e3 class "printIt" SmallInteger
>>>
>>> This has always been the behavior in Squeak too.
>>>
>>
>>
>>      What happens if you try compiling a method containing a literal
>> Fraction and both debug it and decompile it.
>>
>>
> The attach shows that in ST-80 a CompiledMethod can contain a Fraction
> literal. Source code form for that is '1e-3'. Debugger works as in Squeak
> or Cuis.


then if you feel strongly change it back, but you need to fix this:

(1/2) isLiteral false

when you do so.


 Also check these comments from Dan:
>>>
>>>  http://lists.squeakfoundation.org/pipermail/squeak-dev/2000-
> March/013368.html
>
>>
>>
>>      Dan doesn't say anything about Fraction literals in this message.
>>
>
> He does talk about scientific notation '1e3' and '1e-3' meaning not Float,
> but SmallInteger and Fraction. The subject of this thread is "Float parsed
> as Fraction bug".
>
>
>  I don't think this is a bug at all.
>>>
>>
>>
>>      What, that 1e-3 is a Fraction, not a Float?
>>
>
> Yes. That, and allowing for Fraction literals in methods.
>
>
>
>  BTW, Cuis also supports 1r111111111111 = 12 after this :)
>>>
>>
> Cheers,
> Juan Vuletich
>
-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140807/c586bdd0/attachment.htm


More information about the Squeak-dev mailing list