Skip to content

Commit 4c8c852

Browse files
committed
Don't capitalize after colon
1 parent 0b98d00 commit 4c8c852

12 files changed

Lines changed: 23 additions & 23 deletions

01_values.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ press `enter`) also can't be put between quotes. The string has to
227227
stay on a single line.
228228

229229
(((backslash)))To be able to have such characters in a string, the
230-
following notation is used: Whenever a backslash (“\”) is found
230+
following notation is used: whenever a backslash (“\”) is found
231231
inside quoted text, it indicates that the character after it has a
232232
special meaning. A quote that is preceded by a backslash will not end
233233
the string, but be part of it. When an “n” character occurs after a
@@ -336,7 +336,7 @@ console.log("Aardvark" < "Zoroaster")
336336
// → true
337337
----
338338

339-
The way strings are ordered is more or less alphabetic: Uppercase
339+
The way strings are ordered is more or less alphabetic: uppercase
340340
letters are always “less” than lowercase ones, so `"Z" < "a"` is
341341
true, and nonalphabetic characters (“!”, “-”, and so on) are also
342342
included in the ordering. The actual comparison is

03_functions.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ greet("Harry");
317317
console.log("Bye");
318318
----
319319

320-
A run through this program goes roughly like this: The call to
320+
A run through this program goes roughly like this: the call to
321321
`greet` causes control to jump to the start of that function (line
322322
2). It calls `console.log` (a built-in browser function), which takes
323323
control, does its job, then returns control to line 2. Then it
@@ -532,7 +532,7 @@ looping variant does. The function calls itself multiple times with
532532
different arguments to achieve the repeated multiplication.
533533

534534
(((stack overflow)))But this implementation has one important
535-
problem: In typical JavaScript implementations, it's about ten times
535+
problem: in typical JavaScript implementations, it's about ten times
536536
slower than the looping version. Running through a simple loop is a
537537
lot cheaper than calling a function multiple times. On top of that,
538538
using a sufficiently large exponent to this function might cause the
@@ -576,7 +576,7 @@ with loops. Most often these are problems that require exploring or
576576
processing several “branches”, each of which might branch out again
577577
into more branches.
578578

579-
Consider this puzzle: By starting from the number 1 and repeatedly
579+
Consider this puzzle: by starting from the number 1 and repeatedly
580580
either adding 5 or multiplying by 3, an infinite amount of new
581581
numbers can be produced. How would you write a function that, given a
582582
number, tries to find a sequence of such additions and
@@ -795,7 +795,7 @@ it's definitely also possible to have both side effects and return a
795795
value.)
796796

797797
The first helper function in the farm example,
798-
`printZeroPaddedWithLabel`, is called for its side effect: It prints
798+
`printZeroPaddedWithLabel`, is called for its side effect: it prints
799799
a line. The second version, `zeroPad`, is called for its return
800800
value. It is no coincidence that the second is useful in more
801801
situations than the first. Functions that create values are easier to

04_data.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ console.log(mack);
207207

208208
(((Array type)))(((array,methods)))(((push method)))(((pop
209209
method)))(((join method)))The `push` method can be used to add values
210-
to the end of an array. The `pop` method does the opposite: It removes
210+
to the end of an array. The `pop` method does the opposite: it removes
211211
the value at the end of the array and returns it. An array of strings
212212
can be flattened to a single string with the `join` method. The
213213
argument given to `join` determines the text that is glued between the
@@ -582,7 +582,7 @@ should we store these correlations once we compute them?
582582
One possible way is to
583583
store all the correlations in an array, using objects with `name` and
584584
`value` properties. But that makes looking up the correlation for a given
585-
event somewhat cumbersome: You'd have to loop over the whole array
585+
event somewhat cumbersome: you'd have to loop over the whole array
586586
to find the object with the right `name`. We could wrap this lookup process
587587
in a function, but we would still be writing more code, and the
588588
computer would be doing more work, than necessary.
@@ -1175,7 +1175,7 @@ this exercise, write two functions, `reverseArray` and
11751175
`reverseArrayInPlace`. The first, `reverseArray`, takes an array as
11761176
argument and produces a _new_ array that has the same elements in the
11771177
inverse order. The second, `reverseArrayInPlace` does what the
1178-
`reverse` method does: It modifies the array given as argument in order
1178+
`reverse` method does: it modifies the array given as argument in order
11791179
to reverse its elements.
11801180

11811181
Thinking back to the notes about side effects and pure functions in
@@ -1335,7 +1335,7 @@ whose values are also equal when compared with a recursive call to
13351335
To find out whether to compare two things by identity (use the “===”
13361336
operator for that) or by looking at their properties, you can use the `typeof` operator.
13371337
If it produces `"object"` for both values, you should do a deep comparison. But
1338-
you have to take one silly exception into account: By a
1338+
you have to take one silly exception into account: by a
13391339
historical accident, `typeof null` also produces `"object"`.
13401340

13411341
ifdef::html_target[]

05_higher_order.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ the data is that of a family tree, rather than a flat list.
698698

699699
The way we want to reduce this shape is by computing a value for a
700700
given person by combining values from their ancestors. This can be
701-
done recursively: If we are interested in person _A_, we have to
701+
done recursively: if we are interested in person _A_, we have to
702702
compute the values for __A__’s parents, which in turn requires us to
703703
compute the value for __A__’s grandparents, and so on. In principle,
704704
that'd require us to look at an infinite number of people, but since

06_object.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ different shapes, as long as they support the interface it expects.
496496
I am going to work through a slightly more involved example in an
497497
attempt to give you a better idea what polymorphism, as well as
498498
object-oriented programming in general, looks like. The project is
499-
this: We will write a program that, given an array of arrays of table
499+
this: we will write a program that, given an array of arrays of table
500500
cells, builds up a string that contains a nicely laid out
501501
table—meaning that the columns are straight and the rows are aligned.
502502
Something like this:

07_elife.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ console.log(grid.get(new Vector(1, 1)));
168168
(((interface)))Before we can start on the `World` constructor, we must
169169
get more specific about the critter objects that will be living inside
170170
of it. I mentioned that the world will ask the critters what action
171-
they want to take. This works as follows: Each critter object has an
171+
they want to take. This works as follows: each critter object has an
172172
`act` method that, when called, returns an _action_. An action is an
173173
object with a `type` property, which names the type of action the
174174
critter wants to take, for example `"move"`. The action may also
@@ -682,7 +682,7 @@ given a negative number on the left hand side, will return a negative
682682
result. So we add another eight to make sure the sum is positive,
683683
assuming that the `n` argument is never less than -8.
684684

685-
The `act` method, in the simple case, only has to do the following: It
685+
The `act` method, in the simple case, only has to do the following: it
686686
starts “scanning” the critter's surroundings starting from its
687687
left-hand side, and going clockwise (towards the right) until it finds
688688
an empty square. It then moves in the direction of that empty square.

08_error.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ jump back to a place that knows how to handle the problem. That is
353353
what _exception handling_ does.
354354

355355
(((control flow)))(((raise (exception))))(((throw keyword)))(((call
356-
stack)))Exceptions are a mechanism that works like this: It is
356+
stack)))Exceptions are a mechanism that works like this: it is
357357
possible for code to _raise_ (or _throw_) an exception, which is
358358
simply a value. Raising an exception somewhat resembles a
359359
super-charged return from a function—it does not just jump out of the
@@ -424,7 +424,7 @@ Well, almost...
424424

425425
== Cleaning up after exceptions ==
426426

427-
(((cleaning up)))Consider the following situation: A function
427+
(((cleaning up)))Consider the following situation: a function
428428
`withContext`, wants to make sure that, during its execution, the
429429
top-level variable `context` holds a specific context value. After it
430430
finishes, it restores this variable to its old value.

09_regexp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ So if we match `"the 3 pigs"` there is a match between positions 4
484484
through the last box and have successfully matched this string.
485485

486486
Conceptually, a regular expression engine looks for a match in a
487-
string as follows: It starts at the start of the string and tries a
487+
string as follows: it starts at the start of the string and tries a
488488
match there. In this case, there _is_ a word boundary there, so it'd
489489
get past the first box, but there is no digit, so it'd fail at the
490490
second box. Then it moves on to the second character in the string,

10_modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ into modules of the code. To refresh your memory, these are the
775775
functions and types defined in that chapter, in order of appearance.
776776

777777
----
778-
Point
778+
Vector
779779
Grid
780780
directions
781781
randomElement
@@ -814,7 +814,7 @@ functions.
814814

815815
----
816816
Module "grid"
817-
Point
817+
Vector
818818
Grid
819819
directions
820820

15_game.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ by handling key events.
6161

6262
The screen- and keyboard-related code is only a tiny portion of the
6363
work we need to do to implement this game. Since everything looks like
64-
single-color boxes, drawing is uncomplicated: We create DOM elements,
64+
single-color boxes, drawing is uncomplicated: we create DOM elements,
6565
and use styling to give them a background color, size, and position.
6666

6767
We can represent the background, which is a static grid, as a table of
@@ -1205,7 +1205,7 @@ arguments to a function, calling that function provides an elegant way
12051205
to transition to a new state.
12061206

12071207
In any case, when a level is lost, there should now be two possible
1208-
state transitions: If that was the last life, we go back to level zero
1208+
state transitions: if that was the last life, we go back to level zero
12091209
with the starting amount of lives. If not, we repeat the current level
12101210
with one less life remaining.
12111211

0 commit comments

Comments
 (0)