Skip to content

Commit

Permalink
add and extend top-level index entries for do it, print it, inspect i…
Browse files Browse the repository at this point in the history
…t, explore it
  • Loading branch information
LinqLover committed Nov 26, 2023
1 parent b4c4d64 commit a7e06f0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion BasicClasses/BasicClasses.tex
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ \section{Object}
%-----------------------------------------------------------------
\subsection{Printing}
Every object in Smalltalk can return a printed form of itself.
You can select any expression in a workspace and select the \menu{print it} menu item:
You can select any expression in a workspace and select the \menu{print it} menu item: \index{print it}
This executes the expression and asks the returned object to print itself.
In fact, this sends the message \ct{printString} to the returned object.
The method \mthind{Object}{printString}, which is a \ind{template method}, at its core sends the message \mthind{Object}{printOn:} to its receiver.
Expand Down
5 changes: 3 additions & 2 deletions Environment/Environment.tex
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ \subsubsection{Browsing code}
When you are writing code you will almost certainly need at least two: one for the method that you are typing, and another to browse around the system to see what to type.
You can also open a browser on a class named by any selected text using the \short{b} keyboard shortcut.
\index{system browser!browse button}
\index{keyboard shortcuts!browse it}
\index{browse it}

\dothis{Try this: in a workspace window, type the name of a class (for instance \ct{ScaleMorph}), select it, and then press \short{b}. This trick is often useful; it works in any text window.}

Expand Down Expand Up @@ -608,6 +608,7 @@ \section{The inspector and the explorer}
\subsection{The inspector}

\dothis{As an illustration of what you can do with an \ind{inspector}, type \ct{TimeStamp now} in a workspace, and then choose \menu{inspect it} from the \ind{yellow button} menu.
\index{inspect it}
(It's not necessary to select the text before using the menu; if no text is selected, the menu operations work on the whole of the current line.
You can also type \short{i} for \menu{\textbf{i}nspect it}.)}
\clsindex{TimeStamp}
Expand Down Expand Up @@ -790,7 +791,7 @@ \subsection{The instance browser}
However, this window is more interesting as it still knows about the \ct{PluggableListMorph} for which we opened it.
Thus, we can evaluate code in the code pane.

\dothis{In the browser, open the method \ct{fullListSize} by selecting it in the list at the top right. Then, navigate to the last code line and \menu{print it} (\short{p}). You should see the result of evaluating the expression right within the code editor.}
\dothis{In the browser, open the method \ct{fullListSize} by selecting it in the list at the top right. Then, navigate to the last code line and \menu{print it} (\short{p}). \index{print it} You should see the result of evaluating the expression right within the code editor.}

\begin{ExecuteSmalltalkScript}
SBEScreenshotRecorder writeTo: './figures/instanceBrowser.png' building: [:helper |
Expand Down
2 changes: 1 addition & 1 deletion FAQ/FAQ.tex
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ \section{Browsing the system}
\end{faq}
\answer
\short{b} (browse) on the class name, \short{f} in the category pane of the class browser, or the global search on the top right of the world.
\index{keyboard shortcuts!browse it}
\index{browse it}
\index{keyboard shortcuts!find ...}

\begin{faq}
Expand Down
3 changes: 2 additions & 1 deletion FirstApp/FirstApp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ \section{Inspecting an object}
You can test the effect of the code you have written by creating a new \ct{SBECell} object and inspecting it.

\dothis{Open a workspace.
Type the expression \ct{SBECell new} and \menu{inspect it}.}
Type the expression \ct{SBECell new} and \menu{inspect it}.
\index{inspect it}}

\begin{ExecuteSmalltalkScript}
SBEScreenshotRecorder writeTo: './figures/SBECellInspector.png' frame: #morphs building: [:helper |
Expand Down
1 change: 1 addition & 0 deletions Preface/Preface.tex
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ \section*{Examples and exercises}

We have tried to provide as many examples as possible.
In particular, there are many examples that show a fragment of code that can be evaluated.
\index{print it}
We use the symbol \ct{-->} to indicate the result that you obtain when you select an expression and \menu{print it}:

\begin{code}{@TEST}
Expand Down
14 changes: 11 additions & 3 deletions QuickTour/QuickTour.tex
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ \section{Workspaces and transcripts}
Notice how an entire word, entire string, or the whole text is selected, depending on where you click.

\dothis{Select the text you have typed and yellow-click.
\index{do it}
Select \menu{do it (d)}.}
Notice how the text ``hello world'' appears in the transcript window
(\figref{doit}).
Expand Down Expand Up @@ -479,7 +480,8 @@ \section{Keyboard shortcuts}
(We will indicate these generically as \short{\emph{key}}.)
\dothis{Evaluate the expression in the workspace again, but using the keyboard shortcut: \short{d}.}
\index{keyboard shortcuts!do it}
\index{do it}
\index{keyboard shortcuts!do it|seealso{do it}}
In addition to \menu{do it}, you will have noticed \menu{print it}, \menu{inspect it} and \menu{explore it}.
Let's have a quick look at each of these.
Expand All @@ -491,6 +493,7 @@ \section{Keyboard shortcuts}
Normally the result \ct{7} will have been computed and returned to you, but since the workspace did not know what to do with this answer, it simply threw the answer away.
If you want to see the result, you should \menu{print it} instead.
\menu{print it} actually compiles the expression, executes it, sends the message \ct{printString} to the result, and displays the resulting string.
\index{print it}
\dothis{Select \ct{3 + 4} and \menu{print it} (\short{p}).}
This time we see the result we expect (\figref{printit}).
Expand All @@ -517,6 +520,8 @@ \section{Keyboard shortcuts}
\noindent
We use the notation \ct{-->} as a convention in this book to indicate that a particular \sq expression yields a given result when you \menu{print it}.

\index{inspect it}
\index{keyboard shortcuts!inspect it|seealso{inspect it}}
\dothis{Delete the highlighted text ``\ct{7}'' (\sq should have selected it for you, so you can just press the delete key).
Select \ct{3 + 4} again and this time \menu{inspect it} (\short{i}).}
\noindent
Expand Down Expand Up @@ -545,10 +550,11 @@ \section{Keyboard shortcuts}
\dothis{Type \ct{self squared} in the bottom panel of the inspector on \ct{7} and \menu{print it}.}
\index{explore it}
\needlines{2}
\dothis{Close the inspector.
Type the expression \ct{Object} in a workspace and this time \menu{explore it} (\short{I}, uppercased i).}
\index{keyboard shortcuts!explore it}
\index{keyboard shortcuts!explore it|seealso{explore it}}
\index{explorer}
This time you should see a window labeled \clsind{Object} containing the text
Expand Down Expand Up @@ -658,7 +664,9 @@ \section{Finding classes}
\dothis{Type \ct{Boolean browse} into a workspace and \menu{do it}.}
A browser will open on the Boolean class (\figref{browseBoolean}).
There is also a keyboard shortcut \short{b} (browse) that you can use in any tool where you find a class name; \index{keyboard shortcuts!browse it}, select the name and type \short{b}.
There is also a keyboard shortcut \short{b} (browse) that you can use in any tool where you find a class name; select the name and type \short{b}.
\index{browse it}
\index{keyboard shortcuts!browse it|seealso{browse it}}
\dothis{Use the keyboard shortcut to browse the class \ct{Boolean}.}
Expand Down

0 comments on commit a7e06f0

Please sign in to comment.