diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 423110cf..d3417841 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: matrix: smalltalk: ${{ fromJson(needs.args.outputs.squeak-versions) }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: hpi-swa/setup-smalltalkCI@v1 with: smalltalk-image: Squeak64-${{ matrix.smalltalk }} @@ -74,7 +74,7 @@ jobs: matrix: smalltalk: ${{ fromJson(needs.args.outputs.squeak-versions) }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: hpi-swa/setup-smalltalkCI@v1 with: smalltalk-image: Squeak64-${{ matrix.smalltalk }} @@ -85,7 +85,7 @@ jobs: name: 📄 Collect listings from SmalltalkSources runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: make listings - name: 💾 Store listings uses: actions/upload-artifact@master @@ -101,7 +101,7 @@ jobs: matrix: smalltalk: ${{ fromJson(needs.args.outputs.squeak-versions) }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: hpi-swa/setup-smalltalkCI@v1 with: smalltalk-image: Squeak64-${{ matrix.smalltalk }} diff --git a/BasicClasses/BasicClasses.tex b/BasicClasses/BasicClasses.tex index 43846b93..1eca0ad5 100644 --- a/BasicClasses/BasicClasses.tex +++ b/BasicClasses/BasicClasses.tex @@ -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. @@ -951,9 +951,9 @@ \section{Exceptions} Using \ct{pass}, you can design your exception handlers to only handle some exceptions based on their state and pass all others to the next handler: \begin{code}{NB: CANNOT TEST} - [self downloadData] - on: ConnectionRefused do: [:ex | - self cache at: ex host ifAbsent: [ex pass]]. +[self downloadData] + on: ConnectionRefused do: [:ex | + self cache at: ex host ifAbsent: [ex pass]]. \end{code} This example tries to download some data from a server, but if the connection is refused, it will try to fallback to an offline cache. @@ -968,11 +968,11 @@ \section{Exceptions} For instance, most dialogs in \sq signal a \clsind{ProvideAnswerNotification} before they show up to the user, which allows the code that eventually triggered the dialog to automatically answer the question: \begin{code}{NB: CANNOT TEST} - Morph new exportAsPNG. --> "a file dialog opens for entering a file name" +Morph new exportAsPNG. --> "a file dialog opens for entering a file name" - [Morph new exportAsPNG] - on: ProvideAnswerNotification - do: [:ex | ex resume: 'myMorph.png']. --> "no dialog opens, the file is saved as 'myMorph.png'" +[Morph new exportAsPNG] + on: ProvideAnswerNotification + do: [:ex | ex resume: 'myMorph.png']. --> "no dialog opens, the file is saved as 'myMorph.png'" \end{code} Note that specifically for handling \clsindplural{ProvideAnswerNotification}, there are the more convenient methods \cmind{BlockClosure}{valueSupplyingAnswers:} and \cmind{BlockClosure}{valueSuppressingMessages:}. @@ -986,9 +986,9 @@ \section{Exceptions} For instance, the following would be equivalent to the first example above: \begin{code}{@TEST} - [(-2 to:2) collect: [:i | 100 / i]] - on: ZeroDivide - do: [:ex | ex return: nil]. +[(-2 to:2) collect: [:i | 100 / i]] + on: ZeroDivide + do: [:ex | ex return: nil]. \end{code} \end{itemize} diff --git a/Bibliography/LatexTemplates/st80demo.tex b/Bibliography/LatexTemplates/st80demo.tex index fd0e11ee..f830c277 100644 --- a/Bibliography/LatexTemplates/st80demo.tex +++ b/Bibliography/LatexTemplates/st80demo.tex @@ -23,11 +23,11 @@ \section*{Code environments using the listings package} %============================================================= \subsection*{Listings environments and macros} -The code environments +The code environments \begin{verbatim} \begin{code} - ... +... \end{code} \end{verbatim} take plain, verbatim code, @@ -39,12 +39,12 @@ \subsection*{Listings environments and macros} true & false not & (nil isNil) ifFalse: [self halt]. y _ self size + super size. #($a #a 'a' 1 1.0) - do: [:each | Transcript - show: (each class name); + do: [:each | Transcript + show: (each class name); show: ' '; show: (each printString). { 1 + 2 . 3 \\ 4 . 1 << 3. 2 >> 5 . 1 % 2 }. -^ x < y +^ x < y \end{code} QWERTY layout: @@ -70,7 +70,7 @@ \subsection*{Listings environments and macros} plain code and !\textbf{bolded text}! \end{code} -% ^ $ \\ % # ' +% ^ $ \\ % # ' In-line code with \verb|\ct| is typed like this \verb|\ct{1 + 2 --> 3}| and looks like this: \ct{1 + 2 --> 3}, text can follow immediately. The ``brackets'' around \verb|\ct| can be any matching pair of characters, useful if you want \ct${ and }$ in the code. diff --git a/Collections/Collections.tex b/Collections/Collections.tex index 02e71a80..ba3195cf 100644 --- a/Collections/Collections.tex +++ b/Collections/Collections.tex @@ -34,7 +34,6 @@ \chapter{Collections} %\sd{Did a first pass: I should have a look at Xavier Briffault's book and at the material mentionned by andrew + lalonde book?} %\pre{Removed the abstract, high-level, number-heavy introduction on the collection hierarchy} %============================================================= -\section{Introduction} To make good use of the collection classes, \st programmers need at least an overview of the wide variety of collections and their commonalities and differences. % @@ -377,17 +376,17 @@ \section{Examples of key classes} Array withAll: #(7 3 1 3) --> #(7 3 1 3) OrderedCollection withAll: #(7 3 1 3) --> an OrderedCollection(7 3 1 3) SortedCollection withAll: #(7 3 1 3) --> a SortedCollection(1 3 3 7) -Set withAll: #(7 3 1 3) --> a Set(7 1 3) -Bag withAll: #(7 3 1 3) --> a Bag(7 1 3 3) +Set withAll: #(7 3 1 3) --> !\SqVersionSwitch{6.1}{a Set(1 3 7)}{a Set(7 1 3)}! +Bag withAll: #(7 3 1 3) --> !\SqVersionSwitch{6.1}{a Bag(1->1 3->2 7->1)}{a Bag(7 1 3 3)}! \end{code} \begin{code}{@TEST} Array newFrom: #(7 3 1 3) --> #(7 3 1 3) OrderedCollection newFrom: #(7 3 1 3) --> an OrderedCollection(7 3 1 3) SortedCollection newFrom: #(7 3 1 3) --> a SortedCollection(1 3 3 7) -Set newFrom: #(7 3 1 3) --> a Set(7 1 3) -Bag newFrom: #(7 3 1 3) --> a Bag(7 1 3 3) -Dictionary newFrom: {1 -> 7 . 2 -> 3 . 3 -> 1 . 4 -> 3} --> a Dictionary(1->7 2->3 3->1 4->3 ) +Set newFrom: #(7 3 1 3) --> !\SqVersionSwitch{6.1}{a Set(1 3 7)}{a Set(7 1 3)}! +Bag newFrom: #(7 3 1 3) --> !\SqVersionSwitch{6.1}{a Bag(1->1 3->2 7->1)}{a Bag(7 1 3 3)}! +Dictionary newFrom: {1 -> 7 . 2 -> 3 . 3 -> 1 . 4 -> 3} --> !\SqVersionSwitch{6.1}{a Dictionary(1->7 2->3 3->1 4->3)}{a Dictionary(1->7 2->3 3->1 4->3 )}! \end{code} \noindent Note that these two methods are not identical. diff --git a/Environment/Environment.tex b/Environment/Environment.tex index f16f117e..784b48c0 100644 --- a/Environment/Environment.tex +++ b/Environment/Environment.tex @@ -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.} @@ -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} @@ -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 | @@ -1119,6 +1120,7 @@ \subsection{From the debugger to tests and back again} StringTest >> #testSuffixFound. StringTest >> #testSuffixNotFound. StringTest >> #testShout. + StringTest compiledMethodAt: #testFindLiteralBooleanOrNil ifAbsent: []. StringTest >> #testPercentEncodingJa. } after: block]. String compile: 'suffix @@ -1135,6 +1137,7 @@ \subsection{From the debugger to tests and back again} . StringTest compile: 'testShout'. "To prevent a failure from this test" StringTest removeSelector: #testSuffixNotFound. + StringTest removeSelector: #testFindLiteralBooleanOrNil. StringTest removeSelector: #testPercentEncodingJa. "very slow" testRunner := TestRunner newForSuite: StringTest suite. testRunner runAll. @@ -1273,7 +1276,7 @@ \section{The process browser} \figref{processBrowser} shows a screenshot. The top-left pane lists all of the processes in \sq, in priority order, from the timer interrupt watcher at priority 80 to the idle process at priority 10. Of course, on a uniprocessor, when you look which program is running, the only process that can be running is the UI process, as it is currently displaying the information to you; all of the other will be waiting for some kind of event. -By default, the display of processes is static; it can be updated using the \ind{yellow button} menu, which also provides an option to \menu{turn on auto-update (a)} +By default, the display of processes is static; it can be updated using the \ind{yellow button} menu, which also provides an option to \menu{turn on auto-update (a)}. If you select a process in the top-left pane, its stack trace is displayed in the top-right pane, just as with the debugger. If you select a stack frame, the corresponding method is displayed in the bottom pane. @@ -1407,7 +1410,7 @@ \section{Other interesting tools} \begin{minipage}[t]{0.48\textwidth} \ifluluelse {\includegraphics[width=\textwidth]{SpaceTally}} - {\includegraphics[scale=0.7]{exploreWithLabel: 'SpaceTally'}} + {\includegraphics[scale=0.7]{SpaceTally}} \label{fig:SpaceTally} \end{minipage} \caption{A time profiler (left) and a space tally (right).} diff --git a/FAQ/FAQ.tex b/FAQ/FAQ.tex index 419dea83..0a1850cb 100644 --- a/FAQ/FAQ.tex +++ b/FAQ/FAQ.tex @@ -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} @@ -302,7 +302,7 @@ \section{Using Monticello and SqueakSource} \end{faq} \answer \begin{enumerate} - \item Find the project you want in \url{squeaksource.com} + \item Find the project you want in \url{https://squeaksource.com} \item Copy the registration code snippet \item Select \menu{World docking bar~\go{} Tools~\go{} Monticello browser} \item Select \menu{+Repository~\go{} HTTP} @@ -316,7 +316,7 @@ \section{Using Monticello and SqueakSource} \end{faq} \answer \begin{enumerate} - \item Go to \url{squeaksource.com} + \item Go to \url{https://squeaksource.com} \item Register yourself as a new member \item Register a project (name = category) \item Copy the Registration code snippet diff --git a/FirstApp/FirstApp.tex b/FirstApp/FirstApp.tex index d1f92ac2..1252276a 100644 --- a/FirstApp/FirstApp.tex +++ b/FirstApp/FirstApp.tex @@ -80,7 +80,7 @@ \section{Creating a new class category} We have already seen the \ind{system browser} in \charef{quick}, where we learned how to navigate to classes and methods, and saw how to define new methods. Now we will see how to create system categories and classes. -\seeindex{system category}{category} +\seeindex{system category}{category, system} \seeindex{class category}{system category} \index{category!creating} @@ -133,16 +133,16 @@ \section{Defining the class SBECell} As yet there are of course no classes in the new category. However, the main editing pane displays a template to make it easy to create a new class (see \figref{classTemplate}). -This template shows us a \st expression that sends a message to a class called \ct{Object}, asking it to create a subclass called \ct{NameOfSubClass}. +This template shows us a \st expression that sends a message to a class called \ct{Object}, asking it to create a subclass called \ct{NameOfSubclass}. The new class has no variables and should belong to the category \scat{SBE-Quinto}. We now modify the template to create the class that we want. \dothis{Modify the class creation template as follows:} -\begin{itemize} +\begin{enumerate} \item Replace \clsind{Object} by \clsind{SimpleSwitchMorph}. - \item Replace \ct{NameOfSubClass} by \clsind{SBECell}. + \item Replace \ct{NameOfSubclass} by \clsind{SBECell}. \item Add \ct{mouseAction} to the list of instance variables. -\end{itemize} +\end{enumerate} The result should look like \clsref{firstClassDef}. \begin{classdef}[firstClassDef]{Defining the class \ct| SBECell|.} @@ -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 | @@ -767,7 +768,7 @@ \section{Saving and sharing Smalltalk code} The yellow-button menu in the System Categories pane will give you the option to file out the whole of category \scat{SBE-Quinto}. The resulting file is more or less human-readable, but is really intended for computers, not humans. You can email this file to your friends, and they can file it into their own \squeak images using drag-and-drop. -\seeindex{saving code}{categories} +\seeindex{saving code}{file, filing out} \seeindex{category!filing out}{file, filing out} \seeindex{class!filing out}{file, filing out} \seeindex{method!filing out}{file, filing out} @@ -786,7 +787,7 @@ \section{Saving and sharing Smalltalk code} \subsection{Monticello packages} Although fileouts are a convenient way of making a snapshot of the code you have written, they do not work well for long-running projects. -Just as most open-source projects find it much more convenient to maintain their code in a repository using \ind{Git}\footnote{\url{www.git-scm.com}} or \ind{Mercurial}\footnote{\url{www.mercurial-scm.org}}, so \squeak programmers find it more convenient to manage their code using \ind{Monticello} packages. +Just as most open-source projects find it much more convenient to maintain their code in a repository using \ind{Git}\footnote{\url{https://www.git-scm.com}} or \ind{Mercurial}\footnote{\url{https://www.mercurial-scm.org}}, so \squeak programmers find it more convenient to manage their code using \ind{Monticello} packages. These packages are represented as files with names ending in \ct{.mcz}; they are actually zip-compressed bundles that contain the complete code of your \ind{package}. Using the Monticello package browser, you can save packages to repositories on various types of servers, including FTP and HTTP servers; you can also just write the packages to a repository in a local file system directory. @@ -833,12 +834,12 @@ \subsection{Saving and loading code with Monticello} \subsection{\ind{SqueakSource}: a sharing platform for Monticello} We think that the best way to save your code and share it is to create an account for your project on a SqueakSource server. -SqueakSource is similar to GitHub\footnote{\url{www.github.com}}: +SqueakSource is similar to GitHub\footnote{\url{https://www.github.com}}: It is a web front-end to an HTTP Monticello server that lets you manage your projects. -There is a public SqueakSource server at \url{http://www.squeaksource.com}, and a copy of the code related to our game is stored there at \sbeSqueaksourceUrl. +There is a public SqueakSource server at \url{https://www.squeaksource.com}, and a copy of the code related to our game is stored there at \sbeSqueaksourceUrl. You can look at this project with a web browser, but it's a lot more productive to do so from inside \squeak, using the Monticello browser, which lets you manage your packages. -\dothis{Open a web browser to \url{www.squeaksource.com}. +\dothis{Open a web browser to \url{https://www.squeaksource.com}. Create an account for yourself and then create (\ie ``register'') a project for the Quinto game.} SqueakSource will show you the information that you should use when adding a repository using the Monticello browser. diff --git a/Model/Model.tex b/Model/Model.tex index cddd2038..95853cb4 100755 --- a/Model/Model.tex +++ b/Model/Model.tex @@ -575,7 +575,7 @@ \section{Everything happens by sending messages} One of the consequences of \st's model of message sending is that it encourages a style in which objects tend to have very small methods and delegate tasks to other objects, rather than implementing huge, procedural methods that assume too much responsibility. Joseph Pelrine expresses this principle succinctly as follows: -\important{Don not do anything that you can push off onto someone else.} +\important{Do not do anything that you can push off onto someone else.} \index{Pelrine, Joseph} \ab{Citation?} \on{sorry, just personal communication and my own lecture notes!} diff --git a/Morphic/Morphic.tex b/Morphic/Morphic.tex index eb0ddd1b..a584c7a3 100644 --- a/Morphic/Morphic.tex +++ b/Morphic/Morphic.tex @@ -659,10 +659,10 @@ \subsection{Morphic animations} \dothis{Add the following code to \mthref{handleKeystroke}:} \begin{code}{} - keyValue = $+ asciiValue - ifTrue: [self startStepping]. - keyValue = $- asciiValue - ifTrue: [self stopStepping]. +keyValue = $+ asciiValue + ifTrue: [self startStepping]. +keyValue = $- asciiValue + ifTrue: [self stopStepping]. \end{code} % \on{You can also \menu{debug~\go{} inspect morph} and evaluate: \ct{self currentWorld startStepping: self}.} diff --git a/Preface/Preface.tex b/Preface/Preface.tex index a2a332ff..c87a8efe 100644 --- a/Preface/Preface.tex +++ b/Preface/Preface.tex @@ -77,7 +77,7 @@ \section*{An open book} \item The content of this book is released under the Creative Commons Attribution-ShareAlike (by-sa) license. In short, you are allowed to freely share and adapt this book, as long as you respect the conditions of the license available at the following URL: - \url{creativecommons.org/licenses/by-sa/3.0/}. + \url{https://creativecommons.org/licenses/by-sa/3.0/}. \item This book just describes the core of \sq. Ideally, we would like to encourage others to contribute chapters on the parts of \sq that we have not described. @@ -92,11 +92,11 @@ \section*{The \sq community} Here is a short list of resources that you may find useful: \begin{itemize} -\item \url{www.squeak.org} is the main web site of \sq. +\item \url{https://www.squeak.org} is the main web site of \sq. -\item \url{www.squeaksource.com} is the equivalent of GitHub for \sq projects. +\item \url{https://www.squeaksource.com} is the equivalent of GitHub for \sq projects. -\item \url{wiki.squeak.org/squeak} is a wiki with all kinds of information about \sq. +\item \url{https://wiki.squeak.org/squeak} is a wiki with all kinds of information about \sq. \item The \emphind{help browser} inside \sq gives you access to a lot of useful information. For example, it contains an overview of \ind{keyboard shortcuts} and documents several packages and tools. @@ -118,19 +118,19 @@ \section*{The \sq community} \paragraph{Group chats.} Have a question that you need to be answered quickly? Would you like to meet with other squeakers around the world? -The Slack instance at \url{squeak.slack.com} is a great place to participate in longer-term discussions. +The Slack instance at \url{https://squeak.slack.com} is a great place to participate in longer-term discussions. Stop by and say ``Hi!'' \paragraph{Other sites.} Several other websites support the \sq community today in various ways. Here are some of them: \begin{itemize} - \item \url{github.com/squeak-smalltalk} is the GitHub organization hosting new releases and the various \sq websites. + \item \url{https://github.com/squeak-smalltalk} is the GitHub organization hosting new releases and the various \sq websites. - \item \url{github.com/OpenSmalltalk/opensmalltalk-vm} is the repository of the virtual machine running \sq, the Open\-Smalltalk-VM. + \item \url{https://github.com/OpenSmalltalk/opensmalltalk-vm} is the repository of the virtual machine running \sq, the Open\-Smalltalk-VM. - \item \url{bugs.squeak.org} is the bug tracker where you can report any issues you encounter with the system. You can access debug information through \menu{World docking bar~\go{} Help~\go{} Send Feedback}. + \item \url{https://bugs.squeak.org} is the bug tracker where you can report any issues you encounter with the system. You can access debug information through \menu{World docking bar~\go{} Help~\go{} Send Feedback}. - \item \url{source.squeak.org} hosts the repositories for the base system. If you would like to contribute and want to learn about the community development process, you can learn about it directly in \Squeak under \menu{World docking bar~\go{} Help~\go{} Contributing to Squeak}. You can also learn about the community development process at \url{https://squeak.org/development_process/}. + \item \url{https://source.squeak.org} hosts the repositories for the base system. If you would like to contribute and want to learn about the community development process, you can learn about it directly in \Squeak under \menu{World docking bar~\go{} Help~\go{} Contributing to Squeak}. You can also learn about the community development process at \url{https://squeak.org/development_process/}. \end{itemize} @@ -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} diff --git a/QuickTour/QuickTour.tex b/QuickTour/QuickTour.tex index 71688f4d..2c1ea34c 100644 --- a/QuickTour/QuickTour.tex +++ b/QuickTour/QuickTour.tex @@ -43,7 +43,7 @@ \chapter{A quick tour of \sq} %================================================================= \section{Getting started} -\sq is available as a free \ind{download} from \url{www.squeak.org}. +\sq is available as a free \ind{download} from \url{https://www.squeak.org}. Your download will be an archive file that contents vary from platform to platform. However, there are two important components common to all versions (see \figref{download}). @@ -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}). @@ -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. @@ -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}). @@ -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 @@ -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 @@ -639,7 +645,7 @@ \section{The system browser} You may have to scroll down to find it. Now you will see in the fourth pane only methods related to printing. \index{category!method} -\index{category!message|see method} +\index{category!message|see category, method} \dothis{Select the \mthind{Object}{printString} method.} Now we see in the bottom pane the source code of the \ct{printString} method, shared by all objects in the system (except those that override it). @@ -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}.} @@ -997,7 +1005,7 @@ \section{Defining a new method} \end{method} The comma is the string concatenation operation, so the body of this method appends an exclamation mark to an upper-case version of whatever \ct{String} object the \ct{shout} message was sent to. -The \ct{^} tells \sq that the expression that follows is the answer to be returned from the method, in this case, the new concatenated string. +The \ct{^} tells \sq that the expression that follows is the answer to be returned from the method, in this case, the new concatenated string. \cmindex{String}{,} Does this method work? Let's run the tests and see. diff --git a/README.md b/README.md index 1eb967ed..5dd8c4a9 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,16 @@ The usual workflow to **add a scripted screenshot to the book** is as follows: 2. Open the Git Browser and clone this repository. Install missing dependencies as specified in the baseline if necessary. + Alternatively, you can load the project via Metacello, but you won't be able to commit changes back to the repository without cloning it first: + + ```smalltalk + Metacello new + baseline: 'SBE'; + repository: 'github://hpi-swa-lab/SqueakByExample-english:master/SmalltalkSources'; + get; + load. + ``` + 3. Make sure to set the resource directory to the path of your working copy: ```smalltalk @@ -156,7 +166,18 @@ part of the book, you will find that printing 2 up at 140% works well. - Update the sources in the SqueakSource repository (see [SmalltalkSources](#smalltalk-sources)). - Select the draft release from the Releases section on GitHub, edit it, and publish it. -- Publish the PDF using Lulu or whatever else (maybe we should document this process here as well). +- Publish the PDF using Lulu or whatever else + - Lulu: + 1. Create new project + 2. Print book > publish book (via bookstore & global distribution) + 3. Metadata: language (English), Category (Computer & Technology), edition statement, authors, license (CC BY-SA) + 4. Use a free ISBN + 5. Upload PDF (remove the cover page, will be provided separately!) + 6. Paper options: 6x9 inch, color standard, white, paperback, matte + 7. Upload cover & blurb PDF (see `figures/cover`) + 8. Description: copy from previous edition + 9. Category: Adult Education + 10. Set price - Announce the new release on the mailing list, squeak.org, etc. ### 2. Prepare the repository for the next edition diff --git a/SBE.tex b/SBE.tex index 20d16064..e40dacd9 100755 --- a/SBE.tex +++ b/SBE.tex @@ -80,7 +80,7 @@ \end{description} \begin{itemize} \item For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page: - \url{creativecommons.org/licenses/by-sa/3.0/} + \url{https://creativecommons.org/licenses/by-sa/3.0/} \item Any of the above conditions can be waived if you get permission from the copyright holder. \item Nothing in this license impairs or restricts the author's moral rights. \end{itemize} @@ -88,7 +88,7 @@ \parbox{\textwidth-2cm-1em}{ Your fair dealing and other rights are in no way affected by the above. This is a human-readable summary of the Legal Code (the full license):\\ - \url{creativecommons.org/licenses/by-sa/3.0/legalcode}}\\[1cm] + \url{https://creativecommons.org/licenses/by-sa/3.0/legalcode}}\\[1cm] First Edition, September 2007.\\ Revised editions with corrections, March 2008, May 2008, September 2009.\\ Published by Square Bracket Associates, Switzerland.\\ diff --git a/SUnit/SUnit.tex b/SUnit/SUnit.tex index c05f7eb1..26a66562 100644 --- a/SUnit/SUnit.tex +++ b/SUnit/SUnit.tex @@ -30,8 +30,6 @@ \chapter{SUnit} \label{cha:SUnit} %================================================================= -\section{Introduction} - \on{Would be nice to have an example of test-driven development with SUnit from beginning to end. Perhaps this is for another chapter?} \indmain{SUnit} is a minimal yet powerful framework that supports the creation and deployment of tests. @@ -40,7 +38,7 @@ \section{Introduction} \sunit was originally developed by Kent Beck and subsequently extended by Joseph Pelrine and others to incorporate the notion of a resource, which we will describe in \secref{resource}. \index{Beck, Kent} \index{Pelrine, Joseph} -\seeindex{resource}{test, resource} +\seeindex{resource}{TestResource, (class)} The interest in testing and \ind{Test Driven Development} is not limited to \squeak or \st. Automated testing has become a hallmark of the \ind{agile software development} movement, and any software developer concerned with improving software quality would do well to adopt it. @@ -321,7 +319,7 @@ \subsection{Step 5: interpret the results} %================================================================= \section{The \SUnit cook book} This section will give you more details on how to use \SUnit. -If you have used another testing framework such as \JUnit\footnote{\url{junit.org}}, much of this will be familiar, since all these frameworks have their roots in \SUnit. +If you have used another testing framework such as \JUnit\footnote{\url{https://junit.org}}, much of this will be familiar, since all these frameworks have their roots in \SUnit. Normally you will use \SUnit's GUI to run tests, but there are situations where you may not want to use it. %--------------------------------------------------------- \subsection{Other assertions} diff --git a/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/instance/restoreMethods.after..st b/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/instance/restoreMethods.after..st index 68bc58b2..be4fd3ad 100644 --- a/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/instance/restoreMethods.after..st +++ b/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/instance/restoreMethods.after..st @@ -2,7 +2,7 @@ utils restoreMethods: compiledMethods after: aBlock | changeRecords | - changeRecords := compiledMethods + changeRecords := (compiledMethods copyWithout: nil) collect: [:method | method -> (method methodClass changeRecordsAt: method selector) first] as: Dictionary. ^ aBlock ensure: [ diff --git a/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/methodProperties.json b/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/methodProperties.json index 7fd1da82..a799bed0 100644 --- a/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/methodProperties.json +++ b/SmalltalkSources/SBE-Extract.package/SBEWorldHelper.class/methodProperties.json @@ -76,7 +76,7 @@ "prepareForScreenshotOfAll:" : "ct 1/17/2020 15:30", "recordScene:during:" : "ct 12/4/2019 10:20", "resourceDirectory" : "ct 11/18/2019 13:54", - "restoreMethods:after:" : "ct 10/22/2019 15:38", + "restoreMethods:after:" : "ct 12/16/2023 20:53", "runModal:" : "ct 10/18/2019 23:22", "runModal:then:" : "ct 10/15/2020 14:08", "scaleWindow:" : "ct 12/6/2019 12:56", diff --git a/SourceControl/SourceControl.tex b/SourceControl/SourceControl.tex index 955da9a2..c8ad2a2b 100644 --- a/SourceControl/SourceControl.tex +++ b/SourceControl/SourceControl.tex @@ -403,7 +403,7 @@ \subsection{Basic Monticello} Once the package knows about a repository, you can save a new version by selecting the repository and the package in the Monticello Browser, and clicking \button{Save}. Of course, you must have permission to write to a repository. The \ct{SqueakByExample} repository on \emphind{SqueakSource} is world-readable but not world-writable, so if you try and save there, you will see an error message. -However, you can create your own repository on \emph{SqueakSource} by using the web interface at \url{http://www.squeaksource.com}, and use this to save your work. +However, you can create your own repository on \emph{SqueakSource} by using the web interface at \url{https://www.squeaksource.com}, and use this to save your work. This is especially useful as a mechanism to share your code with friends, or if you use multiple computers. \begin{ExecuteSmalltalkScript} diff --git a/Syntax/Syntax.tex b/Syntax/Syntax.tex index 7f380861..29f99238 100755 --- a/Syntax/Syntax.tex +++ b/Syntax/Syntax.tex @@ -157,9 +157,9 @@ \section{Syntactic elements} Nevertheless, you can also write any non-printing character verbatim after the dollar sign, but this is often hard to read: \begin{code}{@TEST} - $ = Character space --> true - $ - = Character cr --> true +$ = Character space --> true +$ + = Character cr --> true \end{code} \item[Strings.] @@ -201,6 +201,7 @@ \section{Syntactic elements} \seeindex{"" ""@{\textsf{"" ""}}}{comment} \item[Temporary variable declaration.] + \index{temporary variable declaration} Vertical bars \ct{| |} enclose the \subind{variable}{declaration} of one or more temporary variables in a method (and also in a block). \seeindex{$\vert\ \vert$@{\textsf{$\vert\ \vert$}}}{temporary variable declaration} \seeindex{variable declaration}{temporary variable declaration} @@ -230,7 +231,7 @@ \section{Syntactic elements} Primitives denote an invocation of a \ind{virtual machine} \ind{primitive.} For instance, \ct{} is the VM primitive for \cmind{SmallInteger}{+}. Any code following the primitive is executed only if the primitive fails. - \seeindex{< >}{\textsf{< >}}{pragma} + \seeindex{< >@\textsf{< >}}{pragma} \item[Unary messages] consist of a single word (such as \ct{factorial}) sent to a receiver (like the number \ct{3}). \index{message!unary} @@ -257,9 +258,9 @@ \section{Syntactic elements} \item[Sequences of statements.] A period or full-stop (\ct{.}) is the \emph{statement} \emphsubind{statement}{separator}. Putting a period between two expressions turns them into independent statements. - \seeindex{full stop}{statement separator} - \seeindex{period}{statement separator} - \seeindex{\ct{.}}{statement separator} + \seeindex{full stop}{statement, separator} + \seeindex{period}{statement, separator} + \seeindex{\ct{.}}{statement, separator} \item[Cascades.] Semicolons can be used to send a \emphind{cascade} of messages to a single receiver. @@ -419,7 +420,7 @@ \section{Block syntax} A \ind{block} is essentially an anonymous function. A block is evaluated by sending it the message \mthind{BlockClosure}{value}. The block answers the value of the last expression in its body unless there is an explicit return (with \ct{^}), in which case it does not answer any value. -\seeindex{value}{BlockClosure} +\seeindex{value}{BlockClosure, value} \begin{code}{@TEST} [1 + 2] value --> 3 @@ -587,9 +588,9 @@ \section{Primitives and pragmas} For example, the following are all implemented as primitives: memory allocation (\mthind{Behavior}{new}, \mthind{Behavior}{new:}), bit manipulation (\mthind{Integer}{bitAnd:}, \mthind{Integer}{bitOr:}, \mthind{Integer}{bitShift:}), -pointer and integer arithmetic (\ct{+}, \ct{-}, \ct{<}, \ct{>}, \ct{*}, \ct{/ }, \ct{=}, \ct{==}...), +pointer and integer arithmetic (\ct{+}, \ct{-}, \ct{<}, \ct{>}, \ct{*}, \ct{/ }, \ct{=}, \ct{==}, ...), and array access (\mthind{Object}{at:}, \mthind{Object}{at:put:}). -\seeindex{new@{\ct{new}}}{\ct{Behavior>>>new}} +\seeindex{new@{\ct{new}}}{Behavior, new} Primitives are invoked with the syntax \ct{}. A method that invokes such a primitive may also include \st code, which will be evaluated \emph{only} if the primitive fails. diff --git a/common.tex b/common.tex index 225cec89..95050f34 100644 --- a/common.tex +++ b/common.tex @@ -119,7 +119,7 @@ \newcommand{\squeak}{Squeak\xspace} \newcommand{\sbeRepoUrl}{\url{https://github.com/hpi-swa-lab/SqueakByExample-english}\xspace} \newcommand{\sbeSqueaksourceUrl}{\url{http://www.squeaksource.com/SqueakByExample60}\xspace} % FOR LATER: use \SqVersionSwitch here -\newcommand{\hpiswa}{\url{hpi.de/swa}\xspace} +\newcommand{\hpiswa}{\url{https://hpi.de/swa}\xspace} %============================================================= %:Markup macros for proof-reading \usepackage[normalem]{ulem} % for \sout @@ -516,7 +516,7 @@ \newcommand{\ind}[1]{\index{#1}#1\xspace} % plain text \newcommand{\subind}[2]{\index{#1!#2}#2\xspace} % show #2, subindex under #1 \newcommand{\emphind}[1]{\index{#1}\emph{#1}\xspace} % emph #1 -\newcommand{\emphsubind}[2]{\index{#1!#2}\emph{#2}\xspace} % show emph #2, subindex inder #1 +\newcommand{\emphsubind}[2]{\index{#1!#2}\emph{#2}\xspace} % show emph #2, subindex under #1 \newcommand{\scatind}[1]{\index{#1@\textsf{#1} (category)}\scat{#1}} % category \newcommand{\protind}[1]{\index{#1@\textsf{#1} (protocol)}\prot{#1}} % protocol % \newcommand{\clsind}[1]{\index{#1@\textsf{#1} (class)}\ct{#1}\xspace} diff --git a/commonDemo.tex b/commonDemo.tex index 141c5b35..e11a6172 100644 --- a/commonDemo.tex +++ b/commonDemo.tex @@ -83,7 +83,7 @@ \section*{Code environments using the listings package} \begin{verbatim} \begin{code}{} - ... +... \end{code} \end{verbatim} take plain, verbatim code, @@ -164,7 +164,7 @@ \subsection{Special conventions} \section*{Other macros} %============================================================= \paragraph{url} -\url{SqueakByExample.org} +\url{https://SqueakByExample.org} % URL protocol is NOT optional for all PDF viewers! %============================================================= \paragraph{names} \SUnit diff --git a/titlepage.tex b/titlepage.tex index 6c2b42e7..f81827d4 100644 --- a/titlepage.tex +++ b/titlepage.tex @@ -12,7 +12,7 @@ \vspace{0.5cm} - \large Christoph Thiede, Patrick Rein + \large Christoph Thiede and Patrick Rein \vspace{0.5cm}