1.3: Saving, Quitting and Restarting a Squeak Session
- Page ID
\(\bigstar\) Bring up the world menu. Now select
new morph . . . and navigate to
from alphabetical list ⊳
BlobMorph. You now have a blob “in hand”. Put the blob down (by clicking) somewhere. It will start to move.
save as . . ., and enter the name “SBE”. Now click on the
Accept(s) button. Now select
save and quit.
Now if you go to the location where the original image and changes files were, you will find two new files called “SBE.image” and “SBE.changes” that represent the working state of the Squeak image at the moment before you told Squeak to
save and quit. If you wish, you can move these two files anywhere that you like on your disk, but if you do so you may (depending on your operating system) need to also move, copy or link to the virtual machine and the .source file.
\(\bigstar\) Start up Squeak from the newly created “SBE.image” file.
Now you should find yourself in precisely the state you were when you quit Squeak. The blob is there again and it continues to move from where it was when you left it.
When you start Squeak for the first time, the Squeak virtual machine loads the image file that you provide. This file contains a snapshot of a large number of objects, including a vast amount of pre-existing code and a large number of programming tools (all of which are objects). As you work with Squeak, you will send messages to these objects, you will create new objects, and some of these objects will die and their memory will be reclaimed (i.e., garbage-collected).
When you quit Squeak, you will normally save a snapshot that contains all of your objects. If you save normally, you will overwrite your old image file with the new snapshot. Alternatively you may save the image under a new name, as we just did.
In addition to the .image file, there is also a .changes file. This file contains a log of all the changes to the source code that you have made using the standard tools. Most of the time you do not need to worry about this file at all. As we shall see, however, the .changes file can be very useful for recovering from errors, or replaying lost changes. More about this later!
The image that you have been working with is a descendant of the original Smalltalk-80 image created in the late 1970s. Some of these objects have been around for decades!
You might think that the image is the key mechanism for storing and managing software projects, but you would be wrong. As we shall see very soon, there are much better tools for managing code and sharing software developed by teams. Images are very useful, but you should learn to be very cavalier about creating and throwing away images, since tools like Monticello offer much better ways to manage versions and share code amongst developers.
\(\bigstar\) Blue-click on the Blob.
You will see a collection of colored dots that are collectively called the blob’s morphic halo. Each dot is called a handle. Click in the pink handle containing the cross; the blob should go away. (You may have to try several times as the Blob squirms around and tries to get away from the mouse.)