Learning Squeak

A wiki page to accompany your venture into SqueakSmalltalk.

 you := Student new.
	"Wherein the humble student begins the journey"

you get: Squeak copy. "The student obtains the software"
  1. Go to http://www.squeak.org/ and look around.
  2. Download the current release for your platform of choice from the handy download box on the main page.
  3. Get squeak running (usually by dragging the Squeak3.0.image file onto the Squeak executable).
  4. "Before you turn something on, learn how to turn it off." To quit Squeak gracefully:
    • 'Quit the Squeak way': left-click on the background and select the "save and quit" or the "quit" menu item.
    • Alternatively, use the "file->quit" menu item from the virtual machine's menu.

 you exploreSqueak.
	"The student becomes familiar with the programming environment"
When you start Squeak you will see: The Squeak UI is different. Familiarize yourself with it by perusing this excellent tutorial: http://minnow.cc.gatech.edu/squeak/uploads/SqueakLanguageRef.3.html

Squeak assumes that you have a 3-button mouse (If you don't, you may have to use the modifier keys specific for your platform). The buttons (for windows users) are: Many commands are issued through menu selections. I'll use the following shorthand in describing menu commands: Menu: MenuNameOrLocation->MenuItem->SubMenuItem->SubSubMenuItem

Now, click into "The Worlds of Squeak" project window. This opens the project and it zooms to take over the screen. Visit the various projects to get an idea of what squeak can do. Play around and explore.

You'll actually learn quite a lot by "playing around" with the Worlds of Squeak projects. They are complete applications that demonstrate some of the advanced capabilities of the environment.

When you're done exploring, go back to the main window: Menu: World->previous project.

 myLab := Project new.
	"The student sets up their workspace."
Both these windows are like text editors. You can type text into them, move around with arrow keys, and delete text. "Command-a" selects all the text in the window.

Right-click in each of these windows to see a window-specific menu.

 World: hello.
	"The traditional rite of passage"
Finally, we are about do to something that might actually look like programming in a regular language. We are going to type text in a window and see what happens...

Type the following into the Workspace window:

 hello := 'Hello, World'.
 Transcript show: hello.
We want to execute, or 'do', this bit of code. Select these two lines. Bring up the Workspace menu (Right-click in the Workspace window) Menu:Workspace->do it (d).

The Transcript window will show:
 Hello, World

Ok, so what just happened?

I suppose I could give you a lot of language syntax rules and say "Them's the rules", but Squeak is far too elegant for that. There's one basic rule that will go a long way. Every Squeak statement follows this format:

object message.

or in English grammer...

noun verb.

Let's parse these two lines like Squeak would. We'll find out what we did, and more importantly, we'll find out what Squeak did.

When you tell Squeak to "do it", Squeak takes the contents of the Workspace and parses it into tokens.

hello
The first token is the object. Squeak searches its list of objects, and if it doesn't find the 'hello' object, it creates the 'hello' object.
:= 'Hello World'.
Everything else in the statement up to the period must be the message.

Transcript
This is the object. Squeak searches its list and finds the Transcript object. It's the Transcript window in your project.
show: hello.
Everything else is the message.

(need to add how Squeak parses the message and looks into the object for the method. Should describe unary, binary, and keyword methods.)


Other Tutorials for Squeak:

Squeak-specific: Smalltalk/Objects in general: There is a Squeak wiki at http://minnow.cc.gatech.edu/squeak/squeak

Some short-and-sweet lessons/examples are in the Squeak Cookbook at http://minnow.cc.gatech.edu/squeak/666


There is a long Morphic tutorial threaded through the Squeak wiki. Here are the links to follow, in order:
(Maybe this should be moved to its own topic, called LearningSqueakMorphic? or something like that.)

(I'm guessing that this will probably happen soon. This page will become a series of lessons, and the other pages will have "A Lesson from LearningSqueak" at the top. This is about the only reason why I like 1 level subpages. Of course, maybe I should just move all this stuff over to the Squeak Wiki and leave this poor wiki alone... -- SeanOleary)

Hmmm.. Maybe we should make SqueakWiki (SqueakSwiki?) one of the SisterSites?


Named Contributors: SeanOleary, KrisJohnson
See also LearningProgrammingLanguages, SmalltalkLearnersClub

EditText of this page (last edited December 12, 2005) or FindPage with title or text search