[squeak-dev] Float parsed as a Fraction bug
J. Vuletich (mail lists)
juanlists at jvuletich.org
Thu Aug 7 23:46:26 UTC 2014
Quoting Levente Uzonyi <leves at elte.hu>:
> On Thu, 7 Aug 2014, J. Vuletich (mail lists) wrote:
>
>> Quoting Eliot Miranda <eliot.miranda at gmail.com>:
>>
>>> On Thu, Aug 7, 2014 at 12:03 PM, J. Vuletich (mail lists) <
>>> juanlists at jvuletich.org> wrote:
>>>
>>>> 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.
>>
>> Well, I don't feel strongly about this, and I don't see what needs
>> to be changed back in Squeak or Cuis.
>>
>> What I say is that the behavior we have in ST-80 / Squeak / Cuis
>> seems right to me, I don't see any problem at all.
>>
>> So, please elaborate: What should be changed back in Squeak (or
>> Cuis)? Why does (1/2) isLiteral = false needs fixing? I mean, where
>> is the bug? (I mean in ST-80, Squeak and Cuis. Not Pharo, where
>> there is a bug while debugging this stuff.)
>
> 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
More information about the Squeak-dev
mailing list
|