Total Newbie: how do I add stuff in squeak?

Philippe de Rochambeau pr1 at club-internet.fr
Tue Feb 10 11:07:34 UTC 1998


christopher tucker wrote:
> 
> Greetings.
> I am taking a Smalltalk class at my university.
> I'm about two weeks into the class.  We're using SmallTalk Express on PC's.
> I downloaded Squeak onto a Mac, and it has got me pretty confused.
> The VM is pretty cool, but I don't really understand it.
> 
> anyway, getting to my question, could someone please tell me how to
> do simple adding of literals and outputting a result?  ie: 3 + 4 and have
> Squeak return 7.  I think once i get the basics down I can do more
> useful tasks.
> 
> -Chris
>  0223361 at acad.nwmissouri.edu
>  http://www.nwmissouri.edu/~0223361


Hello from one beginner to another,

Here is how to have Squeak display "3 + 4":

1) Launch Squeak by double-clicking it.

2) When the Squeak.Image Window appears, click on the grey background and
select the "open..." menu item, then the "open workspace" menu item, in the
Squeak menu (I am not sure what its exact name is).

3) Click on the grey background again and select "open..." then "open
Transcript" in the Squeak menu.

4) Resize both windows and place the Workspace Window above the Transcript
Window so that you can see both.

5) Type "3 + 4" in the Workspace.

6) Click about an inch below "3 + 4" to select it.

7) Move the cursor slowly above the vertical black line left of "3 + 4". The
Workspace's menu will then appear.

8) Keep the mouse button down and select the "print it" menu item. (You can
also do Command-P).

9) The result will appear to the right of the expression.

10) Now delete the entire line (expression + result) by pressing the Backspace
key repeatedly.

11) type "Transcript show: (3 + 4) printString" exactly (without the quotation
marks, of course). This line of code basically means "tell the Transcript to
show the result of 3 + 4 converted to a string".

12) Finally, select the entire line, select the "do it" item in the Workspace
menu. As a result, "7" will appear in the Transcript.

I am currently learn Smalltalk using a book entitled "Smalltalk-80, the
Language", Goldberg and Robson, 1989. Although it does not cover windows,
viewports, etc. it seems like a good introductory book.

Good luck!


Philippe de Rochambeau





More information about the Squeak-dev mailing list