Skip to content

Commit 5af3d25

Browse files
committed
Fixing up epub issues
These caused rendering issues in the output of Pandoc. Detected via: * Bluefire Reader * iBooks * Calibre editor Issues: * `<br>`, apparently * unbalanced tags * code with what looked like html `<tags>`, outside of \`\`\` blocks
1 parent 1af9726 commit 5af3d25

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

docs/chapter1.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
## Introduction to Lisp {docsify-ignore}
1+
# Chapter 1 {docsify-ignore}
2+
## Introduction to Lisp
23

3-
<blockquote>
4-
You think you know when you learn, are more sure when you can write, even more when you can teach, but certain when you can program. <br><br>
5-
<footer>— <cite><a title="Alan Perlis">Alan Perlis, Yale University computer scientist</a></cite></footer>
6-
</blockquote>
4+
> You think you know when you learn, are more sure when you can write, even more when you can teach, but certain when you can program.
5+
> - Alan Perlis, Yale University computer scientist
76
87
This chapter is for people with little or no experience in Lisp. Readers who feel confident in their Lisp programming ability can quickly skim the chapter or skip it entirely. This chapter necessarily moves quickly, so those with little programming experience, or any reader who finds this chapter tough going, should seek out a supplementary introductory text. My recommendations are in the preface.
98

@@ -47,7 +46,7 @@ such as doing multiplications and divisions before sums and differences. We will
4746
Sometimes programmers who are familiar with other languages have preconceptions that make it difficult for them to learn Lisp. For them, three points are worth stressing here. First, many other languages make a distinction between statements and expressions. An expression, like `2 + 2`, has a value, but a statement, like `x = 2 + 2`, does not. Statements have effects, but they do not return values. In Lisp, there is no such distinction: every expression returns a value. It is true that some expressions have effects, but even those expressions also return values.
4847

4948
Second, the lexical rules for Lisp are much simpler than the rules for other languages. In particular, there are fewer punctuation characters: only parentheses, quote marks (single, double, and backward), spaces, and the comma serve to separate symbols from each other. Thus, while the statement `y=a*x+3` is analyzed as seven separate tokens in other languages, in Lisp it would be treated as a single symbol. To get a list of tokens, we would have to insert spaces:
50-
<br> `(y = a * x + 3)`.
49+
`(y = a * x + 3)`.
5150

5251
Third, while many languages use semicolons to delimit statements. Lisp has no need of semicolons, since expressions are delimited by parentheses. Lisp chooses to use semicolons for another purpose—to mark the beginning of a comment, which lasts until the end of the line:
5352

@@ -1230,22 +1229,22 @@ that automatically indent), a much simpler program is possible:
12301229
"Morton Downey, Jr.," and whatever other cases you can think of.
12311230

12321231
&#9635; **Exercise 1.2 [m]** Write a function to exponentiate, or raise a number to an integer power.
1233-
<br>For example: <code>(power 3 2) = 3<sup>2</sup> = 9.</code>
1232+
For example: <code>(power 3 2) = 3<sup>2</sup> = 9.</code>
12341233

12351234
&#9635; **Exercise 1.3 [m]** Write a function that counts the number of atoms in an expression.
1236-
<br>For example: `(count-atoms '(a (b) c)) = 3`. Notice that there is something of an
1235+
For example: `(count-atoms '(a (b) c)) = 3`. Notice that there is something of an
12371236
ambiguity in this:
1238-
<br>should `(a nil c)` count as three atoms, or as two, because it is
1237+
should `(a nil c)` count as three atoms, or as two, because it is
12391238
equivalent to `(a () c)`?
12401239

12411240
&#9635; **Exercise 1.4 [m]** Write a function that counts the number of times an expression
12421241
occurs anywhere within another expression.
1243-
<br>Example: <code>(count-anywhere 'a '(a ((a) b) a)) &rArr; 3</code>.
1242+
Example: <code>(count-anywhere 'a '(a ((a) b) a)) &rArr; 3</code>.
12441243

12451244
&#9635; **Exercise 1.5 [m]** Write a function to compute the dot product of two sequences
12461245
of numbers, represented as lists. The dot product is computed by multiplying
12471246
corresponding elements and then adding up the resulting products.
1248-
<br>Example: <code>(dot-product ' (10 20) ' (3 4)) = 10 x 3 + 20 x 4 = 110</code>
1247+
Example: <code>(dot-product ' (10 20) ' (3 4)) = 10 x 3 + 20 x 4 = 110</code>
12491248

12501249

12511250
### 1.12 Answers

docs/chapter15.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ or (9(n^)), he uses a fine-grained analysis that computes the constant factors (
769769
variety of polynomials, an exponentiation algorithm based on the binomial theorem
770770
is best. The binomial theorem states that
771771

772-
(a + b)<sup>n = &Sigma; TK
772+
(a + b)<sup>n</sup> = &Sigma; TK
773773

774774

775775
i=0

docs/chapter3.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ was printed, along with two possibilities for continuing. The user selected one,
19431943
in a call to make - por r i dge for the new value, and the function succesfully continued.
19441944

19451945
<a id='page-90'></a>
1946-
1946+
```lisp
19471947
> (eat-porridge momma-bear)
19481948
Error: #<MOMMA BEAR>*s porridge is not just right: 39
19491949
Restart actions (select using :continue):
@@ -1954,6 +1954,8 @@ Restart actions (select using :continue):
19541954
Form to evaluate and use to replace (BEAR-PORRIDGE BEAR):
19551955
(make-porridge :temperature just-right)
19561956
nil
1957+
```
1958+
19571959
It may seem like wasted effort to spend time writing assertions that (if all goes well)
19581960
will never be used. However, for all but the perfect programmer, bugs do occur, and
19591961
the time spent antibugging will more than pay for itself in saving debugging time.

docs/chapter5.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
# Chapter 5 {docsify-ignore}
12
## ELIZA: Dialog with a Machine {docsify-ignore}
23

3-
<blockquote>
4-
It is said that to explain is to explain away. <br><br>
5-
<footer>— <cite><a title="Joseph Weizenbaum">Joseph Weizenbaum, MIT computer scientist</a></cite></footer>
6-
</blockquote>
4+
> It is said that to explain is to explain away.
5+
> - Joseph Weizenbaum, MIT computer scientist
76
87
This chapter and the rest of part I will examine three more well-known AI programs of
98
the 1960s. ELIZA held a conversation with the user in which it simulated a psychotherapist.

docs/chapter8.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ with each of the factors. If none of them work, we return an expression indicati
874874
that the integral is unknown.
875875

876876
<a id='page-256'></a>
877-
877+
```lisp
878878
(defun integrate (exp x)
879879
First try some trivial cases
880880
@@ -919,6 +919,7 @@ and elements that don't."
919919
(push item no-list)))
920920
921921
(values (nreverse yes-list) (nreverse no-list))))
922+
```
922923

923924
<a id='page-257'></a>
924925
Note that the place in integrate where other techniques could be added is

0 commit comments

Comments
 (0)