Help - Environment - Workspaces - 2

Previous - Workspaces - Next

2. Editing text and expressions in Squeak

To see the key-board and mouse-commands that work in Workspaces that pop up a (World Menu - help - commandkey help). This puts a textwindow on the screen named "Command Key Actions" that lists and describes all possibilities. Valueing is called so basically because SqL contains a special constant value which when appended to any valid Expression of Smalltalk evaluates the value of the Expression.

As I mentioned above, for mere text-editing there are much better tools than Workspaces which one can use with copy paste if one wants the text in a Workspace. But for brief note-writing it is very adequate, while its strength is writing expressions that can be valued by Squeak and writing code in Squeak.

In what follows I shall sometimes use "3+4 >> 7" etc. for: "3+4" when selected with Cmd-p prints 7 etc. Of course, the example

3+4

is "trivial", but the following simple example when valued is not

2 ln

for Cmd-p-ing (let's say) "2 ln" prints the natural logaritm of 2, which you very probably did not know as precisely.

This works for lots of basic mathematics. Here are a few examples you're advised to select with Cmd-Space and try Cmd-p + Cmd z on repeatedly

2 sin - 7 sin.
7 + 3 + 12.
25/5 + 10.
27 tan.
1 exp.
0.25 + (1/2).

and many more, including the outside Smalltalk rather amazing (and inside too) following calculated number, which again you're advised to select with Cmd-Space and try Cmd-p + Cmd z on repeatedly

100 factorial.

This prints the product of 1*2* .... *100. Also, there is this nicety inherited from Smalltalk

(1/3) + (1/5).
(2/3) + (1/4).

Squeak calculates numerical Fractions as fractions, not as reals! The bracketing is necessary to get the right answers, You really want to see reals? Do

(1/3) + (1/5) asFloat.

I note once more - since I haven't seen this clearly stated anywhere - that the Cmd-Space + Cmd-p + Cmd-z is an excellent way to display input and output alternatively and neatly and the Cmd-p + Cmd-C + Backspace an excellent way of printing and making ready to copy the result elsewhere.

Finally, the coloring of the text in the Workspace is done by way of the menu popped up when pressing Cmd-6 i.e. "Cmd|Alt" plus "6", while the size is set by way of Cmd-a (select all text) and Cmd-k (font-size).

Previous - Workspaces - Next