Issue 4900 in pharo: CompiledMethod printString

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 4900 in pharo: CompiledMethod printString

pharo
Status: Accepted
Owner: [hidden email]
Labels: Type-Bug Milestone-1.4

New issue 4900 by [hidden email]: CompiledMethod printString
http://code.google.com/p/pharo/issues/detail?id=4900

{Object>>#at:} printString

return

'{((CompiledMethod newMethod: 339 header: 17045564) at: 53 put: 16; at: 54  
put: 212; at: 55 put: 172; at: 56 put: 11; at: 57 put: 112; at: 58 put:  
211; at: 59 put: 210; at: 60 put: 155; at: 61 put: 112; at: 62 put: 16; at:  
63 put: 225; at: 64 put: 145; at: 65 put: 112; at: 66 put: 208; at: 67 put:  
135; at: 68 put: 16; at: 69 put: 215; at: 70 put: 156; at: 71 put: 112; at:  
72 put: 16; at: 73 put: 214; at: 74 put: 192; at: 75 put: 124; at: 76 put:  
112; at: 77 put: 213; at: 78 put: 135; at: 79 put: 120; literalAt: 1 put:  
#errorNotIndexable; literalAt: 2 put: #errorSubscriptBounds:; literalAt: 3  
put: #isVariable; literalAt: 4 put: #class; literalAt: 5 put: #isInteger;  
literalAt: 6 put: #errorNonIntegerIndex; literalAt: 7 put: #asInteger;  
litera...


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #1 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Lukas:
"Remove CompiledMethod>>#isSelfEvaluating and everything works as expected."

Stef:
"Yes we should remove that :)
Or at least in that case we should just returns
        (Object>>#at:) printString
                Object>>#at:"


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #2 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

The label of this issue is not accurate.
CompiledMethod>>printOn: is OK.
It's
- either Array>>printOn:
- or CompiledMethod>>storeOn:
that isn't.
At least, they don't mix well


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #3 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

One of these 3 solutions shall be applied
1) remove isSelfEvaluating every where (because it is too costly to  
generalize)
2) correct Array>>printOn: when it isSelfEvaluating to just use printOn:  
rather than storeOn:
3) arrange to have every isSelfEvaluating Object to store as they print.

Note that Float>>storeOn: and Float>>printOn: almost behave the same (but  
for Infinity and NaN). So the use of storeOn: which was decided because of  
Float previous behavior can now be reviewed (carefully).

Solution 1) was applied to Squeak

See  
http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140574.html 
and  
http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140538.html 
for further explanations guiding to current implementation


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #4 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Array>>printAsSelfEvaluatingFormOn: aStream

        aStream nextPut: ${.
        self do: [:el | el printOn: aStream] separatedBy: [ aStream  
nextPutAll: '. '].
        aStream nextPut: $}



(Object>>#at:) printString

'(Object>>#at: "a CompiledMethod(254017536)")'

But


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #5 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Nicolas could you check the situation with float?
Because like that we could clean everything and keep the best of both  
worlds.


Attachments:
        Array-printAsSelfEvaluatingFormOn.st  338 bytes


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo
Updates:
        Status: FixToInclude

Comment #6 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

I integrated the printOn: in 14188


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo
Updates:
        Status: ReviewNeeded

Comment #7 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

So can this be closed?

Definitly it's no FixToInclude?


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo
Updates:
        Cc: [hidden email]

Comment #8 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

I was waiting for nicolas on the float printing.
So if you close it we should reopen a new on that specific point.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #9 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

There is a minor regression for these numbers:

{Float infinity. 1/3.0s1. Float nan} isSelfEvaluating.
Compiler evaluate: {Float infinity. 1/3.0s1. Float nan} printString.

Otherwise, finite Float and unrounded ScaledDecimals will behave correctly.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #10 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

I see, i introduced storeOn: in Issue 1384, and at that time Float did not  
print like they store...

But now, all is OK except edge cases listed in my comment above.
I suggest to change isSelfEvaluating to reflect this situation:

Float>>isSelfEvaluating
     "Currently, Infinity and Nan don't print in a self evaluating format"
     ^self isFinite

Or just remove the method... (It will inherit from Object, then send  
isLiteral which does the same job).

In the second case, we inherit from Fraction, so we cannot remove it
ScaledDecimal>>isSelfEvaluating
     "Not all scaled decimal are self evaluating, because they print rounded  
digits."
     ^self isLiteral



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #11 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Thanks nicolas!!!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #12 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Nicolas when I
- remove Float>>isSeflEvaluating
- add ScaledDecimal>>isSelfEvaluating
     "Not all scaled decimal are self evaluating, because they print rounded  
digits."
     ^self isLiteral

I get an error KeyNotFound key #TypeTable not found when I execute
Compiler evaluate: {Float infinity. 1/3.0s1. Float nan} printString.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #13 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Sure you can't evaluate it this way because it is not self-evaluating...
'an Array(Infinity 0.3s1 NaN)'
So it sounds perfectly normal to me to have a syntax error if you try.

But something is broken in SyntaxError...
Uh, (types := Scanner classPool at: #TypeTable) was ugly anyway...
So it's again some half-done clean-up




_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #14 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Ok for me I just want a good printString.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #15 on issue 4900 by [hidden email]: CompiledMethod printString
http://code.google.com/p/pharo/issues/detail?id=4900

Nicolas why Float infinity does not prints as Float infinity


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo
Updates:
        Status: closed

Comment #16 on issue 4900 by [hidden email]: CompiledMethod printString
http://code.google.com/p/pharo/issues/detail?id=4900

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #17 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Why ?
1) I didn't dare to propose it...
2) inertia ?

http://bugs.squeak.org/view.php?id=1631


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #18 on issue 4900 by [hidden email]: CompiledMethod  
printString
http://code.google.com/p/pharo/issues/detail?id=4900

Ah I finally found the reason
3) lack of neurons available


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4900 in pharo: CompiledMethod printString

pharo

Comment #19 on issue 4900 by [hidden email]: CompiledMethod printString
http://code.google.com/p/pharo/issues/detail?id=4900

Ok I fixed that. Now Float infinity printString Float infinity :)
We also fix the Scanner typeTable issue...
Stef


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker