View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 3 - Matthew Dutton

Discussion 3 - Matthew Dutton

Because in Squeak there aren't declared types for message parameters, you can't always tell what type of object you're suppose to pass with a certain message. Also you might know that you need to send some object a message but not know where in it's inheritance tree that it has been implemented.

In the first case, you can look inside the message that you are curious about and find a place where a message is sent to the object with the unknown type.

Now you know which message you are sending. But in both cases, you still don't know the class of the object.

One useful feature about Squeak is the method finder. With the method finder you can simply type in the name of the message that you are looking for and it will list all the classes that implement it.

Now if you don't know if it's TextMorph or Morph that implements the #extent: message, you can search for the "extent:" message and check which one appears in the list.

A simple way to invoke the method finder is to open the world menu, choose "open...", and select "Method finder".

This will open a small window with a few panes. The pane in the top left is where you enter the message name.

This utility was very helpful for me when I was sorting through all the poorly/non- documented code.




Discussion 3 - Michael Groves
Michael talked about changes to Squeak code being retroactive. This is very helpful because it points out that if, example, you are changing something in the drawOn: message, you don't have to re-create the object. You can simply move it, causing it to redraw itself. If your code breaks, you can fix it in the debugger and try it again on the spot. This is a very powerful feature that few other languages have.

Russell Myers' Discussion 3
Russell gave a quick run through of how AlignmentMorph worked. Delving into the layout management system used in Squeak looked tedious and time consuming. His tutorial saved me a lot of time that I would have had to spend browsing through many methods. Now I can get straight to aligning things without sorting through code for 5 hours first.


Links to this Page