Skip to content

Commit

Permalink
Merge pull request #33 from citizen428/citizen428-chapter-2
Browse files Browse the repository at this point in the history
Chapter 2 fixes.
Thanks for the ongoing review!
  • Loading branch information
hilaire authored May 22, 2024
2 parents 68d5fb6 + 0e9a048 commit 4660392
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions en/chapter-02/contents.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Smalltalk allClasses size
to teach classes, you will likely see
a much larger number.}

To be honest, in our previous chapter we skipped this important detail
To be honest, in our previous chapter, we skipped this important detail
on Smalltalk design. We wrote about message sending without explaining
much, we wanted you to discover this design informally.
The scripts you
Expand Down Expand Up @@ -104,8 +104,8 @@ There are three kinds of messages in @cuis{}:

@end itemize

Unary message selectors consist of alphanumeric characters, and start
with a lower case letter.
Unary message selectors consist of alphanumeric characters and start
with a lowercase letter.

Binary message selectors consist of one or more characters from the
following set:
Expand All @@ -117,7 +117,7 @@ keywords, where each keyword starts with a lower-case letter and ends
with a colon.

@cindex message @subentry precedence
Unary messages have the highest precedence, then binary messages, and
Unary messages have the highest precedence, followed by binary messages, and
finally keyword messages, so:

@smalltalkExample{2 raisedTo: 1 + 3 factorial
Expand All @@ -138,7 +138,7 @@ is not 7. Parentheses must be used to alter the order of evaluation:
@result{} 7}

Parentheses can also be used to make potentially confusing code more
clear. For example, the strict left to right evaluation order can be
clear. For example, the strict left-to-right evaluation order can be
confusing when applied to mathematical expressions. In the Spacewar!
code snippet below, the parentheses make it more clear that the
addition happens first:
Expand Down Expand Up @@ -176,11 +176,11 @@ The @class{Transcript} class is frequently helpful in presenting
useful information when developing an application. An alternative to
the @kbd{Ctrl-d} (@emph{@b{D}o it}) shortcut is @kbd{Ctrl-p}
(@emph{@b{P}rint it}), which executes the script and prints the result
direcly in the Workspace.
directly in the Workspace.

In the @ref{helloCascade}, we have requested no special result. Selecting the
text and typing @kbd{Ctrl-p} results in the default, which is to
return the object to which a message is sent, in this case the
return the object to which a message is sent, in this case, the
@class{Transcript}.

@node Message to string entities
Expand All @@ -189,7 +189,7 @@ return the object to which a message is sent, in this case the
@cindex string @subentry Unicode
@cindex Unicode
As previously stated, a @class{String} is a sequence of @class{Character}
elements, and repersents plain Text (without any formatting).
elements, and represents plain Text (without any formatting).

In Cuis, as in most programming languages, @class{String} literals are a convenient syntax for creating @class{String} instances. These are some examples of @class{String} literals:

Expand Down Expand Up @@ -273,7 +273,7 @@ Messages naturally compose:

An @class{Array} literal starts with a hash or sharp character, @smalltalk{$#}
and parentheses surround the elements of the array.
In this case the elements are @class{Character}s, but they can
In this case, the elements are @class{Character}s, but they can
be instances of any class.

Like @smalltalk{#shuffled}, all collections answer to the message
Expand Down Expand Up @@ -348,7 +348,7 @@ keyword message to the number:
117 isDivisibleBy: 9 @result{} true}

@cindex number @subentry integer @subentry @method{gcd:} (great common divisor)
@cindex number @subentry integer @subentry @method{lcm:} (lest common multiple)
@cindex number @subentry integer @subentry @method{lcm:} (least common multiple)
With specific @dfn{keyword messages} you can compute the Least Common
Multiple and Greatest Common Divisor. A keyword message is composed of
one or more colons ``:'' to insert one or more arguments:
Expand All @@ -373,11 +373,11 @@ done with message sending (See @ref{motionEquations}):
@cindex browser

Smalltalk organizes instance behaviors using classes.
A class is an object which holds a set of methods to be executed
A class is an object that holds a set of methods to be executed
when one of its instances receives a message
that is the name of one of these methods.

The @dfn{System Browser}, in short the @dfn{Browser}, is a tool to
The @dfn{System Browser}, in short, the @dfn{Browser}, is a tool to
rule all the classes in @cuis{}. It is both a tool to explore the
classes (system or user ones) and to write new classes and methods.

Expand Down Expand Up @@ -504,7 +504,7 @@ on the class name will open a Browser on the named class:
@section Spacewar! models

@subsection First classes
In the last chapter we listed the protagonists of the game. Now, we
In the last chapter, we listed the protagonists of the game. Now, we
propose a first implementation of the game model with a set of classes
representing the involved entities:

Expand Down Expand Up @@ -610,7 +610,7 @@ environment, use the File List tool:
You can also drag and drop the package file from your operating system
over to the Squeak window. Upon dropping the file over the window
@cuis{} will ask you what you want to do with this package. To
install it in your enviroment you can simply press @label{Install
install it in your environment you can simply press @label{Install
package}.

Or, you can open a Workspace, type in @smalltalk{Feature require: 'Spacewar!'}
Expand Down

0 comments on commit 4660392

Please sign in to comment.