s LearnSqueak.com

A PRACTICAL DEVELOPMENT WORKFLOW

Meet your
Squeak workbench.

Evaluate. Inspect. Browse. Debug. Save.

Learn the essential tools by working with real objects and a small tutorial class. The logging tool is called Transcript. This lesson uses Workspace, Transcript, Inspector, Explorer, System Browser, and Debugger in Squeak 6.1.

6 essential tools3 recorded walkthroughsA safe counter exercise

Sections 1–4 stand alone. Run the class setup before the counter, Browser, and Debugger sections. All shown code was exercised in the running image; the Debugger halt is intentional and has a cleanup step.

01

TRY IT IN SQUEAK

Workspace: evaluate an idea

A Workspace is a scratch area for Smalltalk expressions. Select a complete example before choosing do it, print it, inspect it, or debug it from the text menu. Do it evaluates for effects; Print it inserts the answer; Inspect it opens the returned object.

Workspace · Print it
'Squeak' asUppercase
Download .st
Result'SQUEAK'
REAL SQUEAK CAPTURESCREENSHOT
Real Workspace Print it action inserts the answer 7
A simple Print it example. Delete the inserted answer before reselecting the whole expression.

Open it with Tools → Workspace or the World menu’s Workspace item. Common shortcuts are Ctrl+D / Ctrl+P on Windows/Linux and Cmd+D / Cmd+P on macOS. Menu commands are the reliable reference when mappings differ.

02

TRY IT IN SQUEAK

Transcript: write explicit output

Transcript is Squeak’s logging tool. It only shows what your code writes to it; evaluating an expression does not automatically print its result there. The code opens a Transcript and writes a greeting and the number 7.

Workspace · select all, then Do it
Transcript open.
Transcript show: 'Hello, Squeak!'; cr.
Transcript show: (3 + 4) printString; cr.
Download .st
REAL SQUEAK CAPTURESCREENSHOT
Transcript window containing Hello Squeak and 7
A genuine Transcript window after executing the snippet.

Use the World menu’s Transcript entry to open the tool without code. The semicolons send show: and cr to the same receiver. Frequent logging inside a fast loop can slow your program.

03

TRY IT IN SQUEAK

Inspector: examine a live object

Inspect a Point. Select x or y to see its coordinates. The lower evaluation pane runs code with self bound to the inspected object. It is a live object, so messages can change it; practice on disposable tutorial objects first.

Workspace · select all, then Do it
(3@4) inspect
Download .st
Inspector evaluation pane · Print it
self x + self y
Download .st
Result7
REAL SQUEAK CAPTUREGIF WALKTHROUGH
Inspector on 3@4 showing y=4 and self x plus self y answering 7
Real field selection and evaluation. The final screenshot is held briefly so the answer is readable.
04

TRY IT IN SQUEAK

Explorer: follow nested references

Explorer is a tree view of objects and the objects they refer to. Expand the triangles beside the nested arrays. It is not a filesystem browser. Unlike Inspector, its evaluation pane binds self to the currently selected node, so check the selection before sending messages.

Workspace · select all, then Do it
{{1. 2}. {'Morphic'. 3@4}} explore
Download .st
REAL SQUEAK CAPTURESCREENSHOT
Object Explorer showing nested arrays and a Point
A real Explorer opened on the nested structure.

Use the inspect control to open a conventional Inspector on the selection; Inspector has an explore control for the opposite direction. Keep the distinction between the root object and selected child in mind.

05

TRY IT IN SQUEAK

Create a safe class to work on

The next sections share one tiny counter class. Run this setup once. It adds only LearnSqueakToolCounter and its listed methods in the LearnSqueak-Tools category. Check the Browser first: if that name already belongs to your work, choose a different name throughout this lesson. Re-running this setup replaces these tutorial methods.

Workspace · select all, then Do it
Object subclass: #LearnSqueakToolCounter
    instanceVariableNames: 'count'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'LearnSqueak-Tools'.
(Smalltalk at: #LearnSqueakToolCounter) compile: 'initialize
    super initialize.
    count := 0'.
(Smalltalk at: #LearnSqueakToolCounter) compile: 'increment
    count := count + 1.
    ^ count'.
(Smalltalk at: #LearnSqueakToolCounter) compile: 'value
    ^ count'.
(Smalltalk at: #LearnSqueakToolCounter) compile: 'pauseAndIncrement
    self halt.
    ^ self increment'.
Download .st

Squeak may ask for your author initials the first time you compile code. Use your own. The pauseAndIncrement method deliberately includes a halt; it is only called in the Debugger exercise. Setup installs it but does not trigger it.

After setup · Workspace Do it
| counter |
counter := LearnSqueakToolCounter new.
counter increment.
counter inspect
Download .st
REAL SQUEAK CAPTURESCREENSHOT
Inspector on a newly incremented tutorial counter
The counter example creates a fresh object and increments it once. Select count to examine its value, 1.
06

TRY IT IN SQUEAK

Browser: connect state to behavior

After setup, open the class with this expression. The screenshot shows Squeak 6.1’s tree-based System Browser. Navigate category → class → protocol → method; the instance/class buttons choose whether you edit instance behavior or class-side behavior.

After setup · Workspace Do it
LearnSqueakToolCounter browse
Download .st
REAL SQUEAK CAPTUREGIF WALKTHROUGH
System Browser on LearnSqueakToolCounter with its methods
Real navigation between increment, value, and pauseAndIncrement. The methods are from the tutorial class.
  1. Select LearnSqueak-Tools → LearnSqueakToolCounter.
  2. Keep instance selected and choose increment.
  3. Read its source in the lower pane. The up-arrow syntax (^) returns a value.
  4. For a safe editing exercise, add or change a double-quoted comment in this tutorial method and choose accept from the source-pane menu. Accept compiles into the running image immediately.

Use senders and implementors to investigate messages. A selector search is not an exact runtime call graph. Do not experiment by rewriting the system’s Object, Integer, or Debugger methods.

07

TRY IT IN SQUEAK

Debugger: pause, inspect, continue

Run this only after setup. It deliberately signals a Halt, so the first notification is expected. Choose Debug to open the full Debugger, then select the LearnSqueakToolCounter → pauseAndIncrement frame rather than editing Object → halt.

After setup · Workspace Do it
LearnSqueakToolCounter new pauseAndIncrement
Download .st
REAL SQUEAK CAPTUREGIF WALKTHROUGH
Debugger paused in the tutorial counter method
Real paused frames and stepping controls, followed by a captured state with count=1.
  1. Read the stack at the top and the selected frame’s source below it.
  2. Select count in the receiver pane: initially it is 0.
  3. Use Over to advance beyond the halt; use Into at the increment send to enter that method.
  4. Continue stepping through the addition and assignment. The highlighted expression moves; count becomes 1.
  5. Choose Proceed to finish. If you want to cancel instead, the initial notifier provides Abandon.

Restart reruns a frame and can repeat side effects. Avoid it on code that sends messages externally, writes files, or performs transactions. Here we only change a disposable counter.

Remove the deliberate breakpoint

After proceeding, run this cleanup. It replaces only the tutorial method, then verifies a fresh counter can increment without halting. Print it answers 1.

After Debugger exercise · Workspace Print it
LearnSqueakToolCounter compile: 'pauseAndIncrement
    ^ self increment'.
LearnSqueakToolCounter new pauseAndIncrement
Download .st
08

TRY IT IN SQUEAK

Save the right thing

Accepting source and saving an image are different operations. Choose a new learning-image name before experiments if you want to keep a clean original.

Accept

Compiles a class or method into the running image. It does not itself write a complete image snapshot.

Save / Save as

The World menu provides these actions for preserving the image’s current object world, including retained state and open tools. Save as lets you create a separate learning image.

File out source

A Browser’s file-out action exports selected source for transfer. Source alone is not a snapshot of all live objects.

Version packages

Package/version-control tools such as Monticello serve a different purpose from saving your whole image. Use the workflow appropriate to your project.

Keep the matching .image and .changes files together, with access to the required .sources file. The .changes file records source changes, not every live object. Do not rename only one member of the image/changes pair.

Close the tutorial tool windows when finished. Keep LearnSqueakToolCounter for later practice, or remove that tutorial class from the Browser when you no longer need it. The halt-removal step makes its normal demonstration method safe to call again.

Explore real working objects.

Use these tools to understand the demos already bundled with Squeak.

Explore built-in Morphic demos

Read further

Screenshots and GIF frames come from real Squeak tool windows. Active-window shadows can change capture dimensions; GIF frames are padded to a common size without simulating tool contents.