Printing block contents in inspector, debugger

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

Printing block contents in inspector, debugger

cedreek
Hi,
http://code.google.com/p/pharo/issues/detail?id=1450

I find annoying that the content of Blocks are not displayed when 
debugging.

So by adding this last line, I can see the content without variable names 
(but that's ok to me)

BlockClosure>>printOn: aStream
	aStream nextPutAll: '[closure] in '.
	outerContext printOn: aStream.
	aStream cr; nextPutAll: self decompile printString. 

What do you think of it ? Has the decompile method some limitations that 
will prevent to use it for such a usage ?

A variation (second file):

BlockClosure>>printOn: aStream
        aStream nextPutAll: self decompile printString.
	aStream nextPutAll: ' in '.
	outerContext printOn: aStream.

that gives by inspecting [1000 factorial]:

{[1000 factorial]} in UndefinedObject>>DoIt

---
When it's not very nice is when inspecting:

[:x :y | | temp | 1 + x@y. ^temp]

{[:t1 :t2 | 
| t3 |
1 + t1 @ t2.
	^ t3]} in UndefinedObject>>DoIt

so here maybe the first version is better.

Last point, I don't know how to get the real variable names and also how to 
remove the code formatting, but that's details.

Thanks

--
Cédrick

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