Skip to content

Commit

Permalink
Apply remaining proofreading fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
munificent committed Jul 16, 2021
1 parent 4fec3b4 commit fec1751
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion book/appendix-ii.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The curly-braced block statement that defines a local scope is introduced in

### Class statement

Class declaration is introduced in, unsurprisingly,
Class declarations are introduced in, unsurprisingly,
"[Classes](classes.html#class-declarations)".

^code stmt-class
Expand Down
3 changes: 2 additions & 1 deletion book/calls-and-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@ keyword.

<aside name="fun">

Yes, I *am* proud of myself for this dumb joke, thank you for asking.
Yes, I am going to make a dumb joke about the `fun` keyword every time it
comes up.

</aside>

Expand Down
2 changes: 1 addition & 1 deletion book/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bagel();

The `makeClosure()` function defines and returns a function. We call it twice
and get two closures back. They are created by the same nested function
declaration `closure`, but close over different values. When we call the two
declaration, `closure`, but close over different values. When we call the two
closures, each prints a different string. That implies we need some runtime
representation for a closure that captures the local variables surrounding the
function as they exist when the function declaration is *executed*, not just
Expand Down
2 changes: 1 addition & 1 deletion book/garbage-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Say we run the GC after the assignment has completed on the second line. The
string "first value" is still sitting in memory, but there is no way for the
user's program to ever get to it. Once `a` got reassigned, the program lost any
reference to that string. We can safely free it. A value is **reachable** if
there is some way for a user program to reference it, otherwise, like the string
there is some way for a user program to reference it. Otherwise, like the string
"first value" here, it is **unreachable**.

Many values can be directly accessed by the VM. Take a look at:
Expand Down
7 changes: 6 additions & 1 deletion book/optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ understand a program's performance just by thinking real hard. Those days are
long gone, separated from the present by microcode, cache lines, branch
prediction, deep compiler pipelines, and mammoth instruction sets. We like to
pretend C is a "low-level" language, but the stack of technology between
`printf("Hello, world!");` and a greeting appearing on screen is now miles tall.

```c
printf("Hello, world!");
```
and a greeting appearing on screen is now perilously tall.
Optimization today is an empirical science. Our program is a border collie
sprinting through the hardware's obstacle course. If we want her to reach the
Expand Down
2 changes: 1 addition & 1 deletion book/types-of-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ large enough source of pain that JS added a separate "strict equality" operator,

PHP considers the strings "1" and "01" to be equivalent because both can be
converted to equivalent numbers, though the ultimate reason is because PHP was
designed by a Lovecraftian Eldritch god to destroy the mind.
designed by a Lovecraftian eldritch god to destroy the mind.

Most dynamically typed languages that have separate integer and floating-point
number types consider values of different number types equal if the numeric
Expand Down
3 changes: 1 addition & 2 deletions note/todo.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Print:

- Order proof from IngramSpark.
- Update index (added Tcl entry).
- Consider justifying challenge and design note prose.
- Decide whether LOC number should be on copyright page.
https://locexternal.servicenowservices.com/auth?id=request_lccn#scroll-to-point
- Fix double barcode on back of KDP version.

eBook:

Expand All @@ -22,7 +22,6 @@ eBook:
- Check out on a few different readers.
- Go through whole book and see how it looks.
- Make sure inline images look OK.
- Fix double barcode on back of KDP version.

Web:

Expand Down
2 changes: 1 addition & 1 deletion site/appendix-ii.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ <h3><a href="#block-statement" id="block-statement"><small>A2&#8202;.&#8202;2&#8
<div class="source-file-narrow"><em>lox/Stmt.java</em>, nest inside class <em>Stmt</em></div>

<h3><a href="#class-statement" id="class-statement"><small>A2&#8202;.&#8202;2&#8202;.&#8202;2</small>Class statement</a></h3>
<p>Class declaration is introduced in, unsurprisingly,
<p>Class declarations are introduced in, unsurprisingly,
&ldquo;<a href="classes.html#class-declarations">Classes</a>&rdquo;.</p>
<div class="codehilite"><div class="source-file"><em>lox/Stmt.java</em><br>
nest inside class <em>Stmt</em></div>
Expand Down
3 changes: 2 additions & 1 deletion site/calls-and-functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,8 @@ <h2><a href="#function-declarations" id="function-declarations"><small>24&#8202;
function declarations first. The <span name="fun">fun</span> starts with a
keyword.</p>
<aside name="fun">
<p>Yes, I <em>am</em> proud of myself for this dumb joke, thank you for asking.</p>
<p>Yes, I am going to make a dumb joke about the <code>fun</code> keyword every time it
comes up.</p>
</aside>
<div class="codehilite"><pre class="insert-before">static void declaration() {
</pre><div class="source-file"><em>compiler.c</em><br>
Expand Down
2 changes: 1 addition & 1 deletion site/closures.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h2><a href="#closure-objects" id="closure-objects"><small>25&#8202;.&#8202;1</s
</pre></div>
<p>The <code>makeClosure()</code> function defines and returns a function. We call it twice
and get two closures back. They are created by the same nested function
declaration <code>closure</code>, but close over different values. When we call the two
declaration, <code>closure</code>, but close over different values. When we call the two
closures, each prints a different string. That implies we need some runtime
representation for a closure that captures the local variables surrounding the
function as they exist when the function declaration is <em>executed</em>, not just
Expand Down
2 changes: 1 addition & 1 deletion site/garbage-collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h2><a href="#reachability" id="reachability"><small>26&#8202;.&#8202;1</small>R
string &ldquo;first value&rdquo; is still sitting in memory, but there is no way for the
user&rsquo;s program to ever get to it. Once <code>a</code> got reassigned, the program lost any
reference to that string. We can safely free it. A value is <strong>reachable</strong> if
there is some way for a user program to reference it, otherwise, like the string
there is some way for a user program to reference it. Otherwise, like the string
&ldquo;first value&rdquo; here, it is <strong>unreachable</strong>.</p>
<p>Many values can be directly accessed by the VM. Take a look at:</p>
<div class="codehilite"><pre><span class="k">var</span> <span class="i">global</span> = <span class="s">&quot;string&quot;</span>;
Expand Down
6 changes: 4 additions & 2 deletions site/optimization.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ <h2><a href="#measuring-performance" id="measuring-performance"><small>30&#8202;
understand a program&rsquo;s performance just by thinking real hard. Those days are
long gone, separated from the present by microcode, cache lines, branch
prediction, deep compiler pipelines, and mammoth instruction sets. We like to
pretend C is a &ldquo;low-level&rdquo; language, but the stack of technology between
<code>printf("Hello, world!");</code> and a greeting appearing on screen is now miles tall.</p>
pretend C is a &ldquo;low-level&rdquo; language, but the stack of technology between</p>
<div class="codehilite"><pre><span class="i">printf</span>(<span class="s">&quot;Hello, world!&quot;</span>);
</pre></div>
<p>and a greeting appearing on screen is now perilously tall.</p>
<p>Optimization today is an empirical science. Our program is a border collie
sprinting through the hardware&rsquo;s obstacle course. If we want her to reach the
end faster, we can&rsquo;t just sit and ruminate on canine physiology until
Expand Down
2 changes: 1 addition & 1 deletion site/types-of-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ <h3><a href="#equality-and-comparison-operators" id="equality-and-comparison-ope
<code>===</code>.</p>
<p>PHP considers the strings &ldquo;1&rdquo; and &ldquo;01&rdquo; to be equivalent because both can be
converted to equivalent numbers, though the ultimate reason is because PHP was
designed by a Lovecraftian Eldritch god to destroy the mind.</p>
designed by a Lovecraftian eldritch god to destroy the mind.</p>
<p>Most dynamically typed languages that have separate integer and floating-point
number types consider values of different number types equal if the numeric
values are the same (so, say, 1.0 is equal to 1), though even that seemingly
Expand Down

0 comments on commit fec1751

Please sign in to comment.