[Newbies] Explorer and MessageTally [was: remembering variables]

Klaus D. Witzel klaus.witzel at cobss.com
Tue Jun 3 06:54:33 UTC 2008

On Tue, 03 Jun 2008 05:57:48 +0200, peter h meadows wrote:

> Ah. Well, more often than not the variables in my code stay as one  
> 'type' of thing. And I thought that generally they would otherwise  
> things would get really confusing!?

For this part of your question use Squeak's explorer. Try (World explore)  
to get an idea what it is about, for example expand the submorph branches  
that you see there.

> Sometimes when I try to understand how a program is working I get lost  
> in the debugger. What I'd like is a kind of overview of what's going on.

For this part of your question try (MessageTally spyOn: [Object  

> Something I can browse and focus in on the parts that seem interesting.

For MessageTally the parts of a computation which really do something are  

> In theory I can do this with the system browser but it doesn't tell me  
> how everything fits together. I want to see an overview of how all the  
> parts fit together.. Who uses what.. Which bits are connected.. The  
> order in which things are done, etc.

MessageTally tells you how the parts of your computation fit together,  
who's using what, and the order in which things are done.

> Can I get the debugger to show a tree of message sends, that I can  
> browse? Something like that?

Yes, MessageTally does that for you: a tree of message sends. From the Spy  
results, you can select a class and browse it for more details, or a  
method and browse its senders or implementors for more details.

> Any ideas? thx.
>>>>>>> "peter" == peter h meadows <phm at sdf.lonestar.org> writes:
>> peter> Oh. I'm still very new to smalltalk. It seemed like it would  
>> help me to
>> peter> understand what's going on. I wanted it to remember everything.  
>> E.g if
>> peter> the thing is an array it will tell me what has been stored in  
>> it. Also,
>> peter> wouldn't it help with code completion? If it knows what type of  
>> object
>> peter> it was in the past it can guess which messages I want to send to
>> peter> it. That would be useful.
>> But the problem is that a given type in the past is not any indication  
>> of
>> a type in the future.
>> You're not "thinking smalltalk" yet.  Stop worrying about types. :)
>> Oh, and they aren't types.  They're instances of classes.
>> If you want to see what's going on, learn to single step in the  
>> debugger.
>> It's quite informative.

More information about the Beginners mailing list