Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Discussion 3 - Ejike Onyekwuluje
Part 1: Create and Post a Discussion
In detail, describe a feature of Squeak that you have found particularly useful. What is the feature? Why is it useful? How do you envoke it?
One feature of Squeak that interests me most is the “Inspect”. Since Squeak is an OO language, everything in it makes you to think in terms of objects: its vocabulary, we send messages to objects, its syntax that imitates English sentences. The Squeak environment has different kinds of tools that facilitate a close relationship with the objects that are created. Everything a user can identify and address in the environment is in fact a Squeak object, that works with Squeak code that is also in the environment, and that can be seen and changed by altering, extending, or even used for other ends by the user. Interestingly, in squeak, all objects understand the message inspect.You open an inspector for instance, and immediately you can send a message to an object, you can recompile within the debugger method on the fly without this edit, compile, and debug loop.
For example, to inspect an instance of class Point, you may simply execute the expression in a workspace:
(Point x: 4 y: 5.6) inspect
The way to execute the inspect expression is to select it in a workspace (or use alt-i), and then “do it”. An Inspector is then opened. The Inspector has both the left-hand pane and the right-hand pane. On the left-hand pane is a list of the instance variables of the object, and the pseudo-variable self that represents the actual object being inspected. By selecting one of the items from this list; the right-hand pane, which is an ordinary text pane, displays the current value of that instance variable. In this way, we can actually inspect any object in the image in some detail.
Right clicking on the left-hand pane brings up a menu, with the inspect being the first item on it. The inspect on the left-hand pane allows the selected instance variable to be inspected; another Inspector is expanded on that object. This allows complex structures of interrelated objects to be explored.
The right-hand pane of the Inspector is a Workspace, and so we can actually select and evaluate expressions in the usual way. However, we can also write expressions, which use the named instance variables and the pseudo-variable self. By so doing, we say that the selected expressions that we evaluate are evaluated in the context of the object that is being inspected.
So, by using Inspect, we are not only able to view the values of instance variables of any object, we are also able to modify the values. In fact, any expression can be typed into the right-hand pane of an Inspector, and by selecting the accept option from the menu, the resulting object is used as the value of the instance variable.
I used the Inspect feature a lot in my M1 to mess around with things that I could not get squeak to do, and by just messing around with the Inspect, I was able to figure out a lot of things in squeak. Using Inspect saves time, and makes learning the language more interesting. It’s a quick way to figure things out on your own.
Part 2: Read Other Posts and Pick a Good One
Next, find two posts that you think are useful. Link to them on your original page and explain why you found them particularly useful.
Discussion 3 - Jiasheng He
I really love this. Opening up multiple browsers, and repeatedly saving my work every time I wanted to view more than one method or class, was not only time consuming, but also very frustrating in my M1. Sometimes, I had to have two copies of squeak running, and it was very irritating. Now that I know about Whisker, I will start using it to save some time from saving my work all the time.
Discussion 3 - Vishal Patel
I think adding color to my code will be a useful thing since it will make reading much easier, and of course appealing to the eyes. I like it, and I will start using it.
Links to this Page