Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc-3 #225

Merged
merged 15 commits into from
Dec 16, 2023
Merged
20 changes: 10 additions & 10 deletions BasicClasses/BasicClasses.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:}.
Expand All @@ -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}

Expand Down
12 changes: 6 additions & 6 deletions Bibliography/LatexTemplates/st80demo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand All @@ -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.
Expand Down
1 change: 0 additions & 1 deletion Collections/Collections.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
%
Expand Down
4 changes: 2 additions & 2 deletions Environment/Environment.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,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.
Expand Down Expand Up @@ -1407,7 +1407,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).}
Expand Down
4 changes: 2 additions & 2 deletions FAQ/FAQ.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down
16 changes: 8 additions & 8 deletions FirstApp/FirstApp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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|.}
Expand Down Expand Up @@ -786,7 +786,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.
Expand Down Expand Up @@ -833,12 +833,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.

Expand Down
2 changes: 1 addition & 1 deletion Model/Model.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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!}
Expand Down
8 changes: 4 additions & 4 deletions Morphic/Morphic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}.}
Expand Down
18 changes: 9 additions & 9 deletions Preface/Preface.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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}

Expand Down
4 changes: 2 additions & 2 deletions QuickTour/QuickTour.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}).

Expand Down Expand Up @@ -997,7 +997,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.

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions SBE.tex
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@
\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}
\raisebox{-0.25cm}{\includegraphics[width=2cm]{CreativeCommons-BY-SA}}\quad
\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.\\
Expand Down
4 changes: 1 addition & 3 deletions SUnit/SUnit.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion SourceControl/SourceControl.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Loading