[squeak-dev] Float parsed as a Fraction bug
J. Vuletich (mail lists)
juanlists at jvuletich.org
Fri Aug 8 13:19:36 UTC 2014
Hi Levente,
I just saw your commit to the inbox. I also had fun with this last
night, and the result is attached. I hope you prefer my version. It is
faster and shorter.
It could also make it easier to do the computation just once instead
of twice (with further refactoring to #isLiteral and #storeOn:).
Cheers,
Juan Vuletich
Quoting "J. Vuletich (mail lists)" <juanlists at jvuletich.org>:
> Quoting Levente Uzonyi <leves at elte.hu>:
>
>>
>> Try debugging the following snippet:
>>
>> | x |
>> x := 5e-1.
>> x := x + 1
>>
>> You'll find that in Cuis it'll be decomipled as:
>>
>> DoIt
>> | x |
>> x _ (1/2).
>> ^ x _ x + 1.
>>
>> And the debugger will get confused (in Squeak and Pharo too),
>> because there's (1/2) instead of 5e-1, which is not a literal.
>> Also if you press Over, then Proceed in the debugger, then the
>> image will become unresponsive in Cuis (Cuis4.2-1766).
>
> Thanks, Levente. This is what I needed.
>
> The debugger becoming unresponsive is an unrelated bug, I just fixed it.
>
> The debugger printing the fraction as a division is a rather minor
> annoyance, not bad enough for giving up the cool '5e-1' syntax, in
> my opinion. But given that the parser can understand '5e-1', the
> fraction should be able to print as a literal. Looks like I'm having
> some numerics fun tonight :)
>
>> Levente
>>
>>>
>>>> --
>>>> best,
>>>> Eliot
>
> Cheers,
> Juan Vuletich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2076-LiteralFractionsFix-JuanVuletich-2014Aug08-09h28m-jmv.1.cs.st
Type: application/vnd.sailingtracker.track
Size: 1996 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140808/1a0f94de/2076-LiteralFractionsFix-JuanVuletich-2014Aug08-09h28m-jmv.1.cs.bin
More information about the Squeak-dev
mailing list
|