Hi Clément,
On Fri, Aug 1, 2014 at 8:07 AM, Clément Bera bera.clement@gmail.com wrote:
Hello,
Natalia I don't think this is a known bug (few people use Float and Fraction in Pharo).
The RBParser parse your floating pointers as Fraction and not as Float (I don't know why).
In the debugger the bytecode pc to source code pointer is mapped by printing the AST. In this case, the AST node (RBLiteralNode) for your float holds a Fraction. The code to print a literal node is as follow:
visitLiteralNode: aLiteralNode aLiteralNode value isLiteral ifFalse: [ self writeString: '''<an unprintable nonliteral value>''' ] ifTrue: [ self writeString: aLiteralNode token storeString ]
and isLiteral answers always false for a Fraction.
A temporary patch consists in adding the method
Fraction>>isLiteral ^ true
Then you can debug your code.
However, I think a real patch would consists in adding the method isLiteral in Fraction but with correct code to answer true only if the fraction can be a literal. Something similar to Float>>#isLiteral.
Find attached the changes I made to Squeak trunk which I think are correct. Basically SqNumberParser will answer Floats, whereas ExtendedNumberParser still answers Fractions. See also http://source.squeak.org/trunk/Kernel-eem.866.mcz
cheers!
2014-08-01 15:40 GMT+02:00 Serge Stinckwich serge.stinckwich@gmail.com:
Yes, I see also the same problem.
I didn't realize until now that : 1-1e-6 is printed as a fraction (try print-it): (999999/1000000)
A little bit strange, no ?
On Fri, Aug 1, 2014 at 3:05 PM, Natalia Tymchuk natalia.tymchuk@unikernel.net wrote:
Hello. When I have the following expression {1-1e-6. 1e-6. 0} in the code and then I debug it I get {(1 - '<an unprintable nonliteral value>'). '<an unprintable nonliteral value>'. 0}.
Is it a known problem or should I report an issue on debug tracker?
Best regards, Natalia
-- Serge Stinckwich UCBN & UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
squeak-dev@lists.squeakfoundation.org