Skip to main content
Engineering LibreTexts

1.3: Saving, Quitting and Restarting a Squeak Session

  • Page ID
    36338
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \(\bigstar\) Bring up the world menu. Now select new morph . . . and navigate to from alphabetical listA-CBlobMorph. You now have a blob “in hand”. Put the blob down (by clicking) somewhere. It will start to move.

    An instance of BlobMorph.
    Figure \(\PageIndex{1}\): An instance of BlobMorph.
    The save as dialogue.
    Figure \(\PageIndex{2}\): The save as . . . dialogue.

    \(\bigstar\) Select Worldsave as . . ., and enter the name “SBE”. Now click on the Accept(s) button. Now select Worldsave 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.)

    The Squeak Tools flap.
    Figure \(\PageIndex{3}\): The Squeak Tools flap.

    This page titled 1.3: Saving, Quitting and Restarting a Squeak Session is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Andrew P. Black, Stéphane Ducasse, Oscar Nierstrasz, Damien Pollet via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.