Skip to content

Commit bbed092

Browse files
committed
minor formatting
1 parent 3739651 commit bbed092

File tree

6 files changed

+43
-26
lines changed

6 files changed

+43
-26
lines changed

xml/chapter3/section2/subsection1.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ function square(x) {
166166
<SCHEME>just syntactic sugar for</SCHEME>
167167
<JAVASCRIPT>
168168
equivalent to<FOOTNOTE>
169-
Footnote<SPACE/><REF NAME="foot:function-decl-vs-lambda"/> mentions
170-
subtle differences between the two in full JavaScript, which we will
171-
ignore in this edition.</FOOTNOTE>
169+
Footnote<SPACE/><REF NAME="foot:function-decl-vs-lambda"/> in chapter 1
170+
mentions subtle differences between the two in full JavaScript, which
171+
we will ignore in this edition.</FOOTNOTE>
172172
</JAVASCRIPT>
173173
</SPLITINLINE>
174174
an underlying implicit

xml/chapter3/section3/subsection4.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,12 +1340,15 @@ function propagate() {
13401340
which places a <QUOTE>probe</QUOTE> on a wire, shows the simulator in
13411341
action. The probe tells the wire that, whenever its signal changes value,
13421342
it should print the new signal value, together with the current time and
1343-
a name that identifies the wire:<SPLITINLINE><JAVASCRIPT>We use
1343+
a name that identifies the
1344+
<SPLITINLINE>
1345+
<SCHEME>wire:</SCHEME>
1346+
<JAVASCRIPT>wire. We use
13441347
the primitive function <JAVASCRIPTINLINE>stringify</JAVASCRIPTINLINE>
1345-
to turn a number into a string. Note that the
1346-
<JAVASCRIPTINLINE>+</JAVASCRIPTINLINE> operator is applied to
1347-
two strings here, which results in the concatenation of the operand
1348-
strings.</JAVASCRIPT></SPLITINLINE>
1348+
to turn a number into a string. Tnhe
1349+
<JAVASCRIPTINLINE>+</JAVASCRIPTINLINE> operator is <EM>overloaded</EM>
1350+
in JavaScript; it can be applied to two strings, in which case the
1351+
result is their concatenation.</JAVASCRIPT></SPLITINLINE>
13491352
<!-- \indcode*{probe}[in digital-circuit simulator] -->
13501353
<SNIPPET>
13511354
<NAME>probe</NAME>

xml/chapter3/section5/subsection4.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ function solve(f, y0, dt) {
322322
equation <LATEXINLINE>$dy/dt=y$</LATEXINLINE> with initial condition
323323
<LATEXINLINE>$y(0)=1$</LATEXINLINE>:<FOOTNOTE><SPLITINLINE>
324324
<JAVASCRIPT>This calculations necessitates the use of the memoization
325-
optimization from section<SPACE/> in the functions
326-
<JAVASCRIPTINLINE>stream_combine</JAVASCRIPTINLINE> and
325+
optimization from section<SPACE/><REF NAME="sec:delayed-lists"/> in
326+
the functions <JAVASCRIPTINLINE>stream_combine</JAVASCRIPTINLINE> and
327327
<JAVASCRIPTINLINE>integral</JAVASCRIPTINLINE>.</JAVASCRIPT>
328328
</SPLITINLINE></FOOTNOTE>
329329
<SNIPPET HIDE="yes">

xml/chapter4/section4/subsection1.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ job(list("Fect", "Cy", "D"), list("computer", "programmer"))
162162
salary(list("Fect", "Cy", "D"), 35000)
163163
supervisor(list("Fect", "Cy", "D"), list("Bitdiddle", "Ben"))
164164

165-
address(list("Tweakit", "Lem", "E"), list("Boston", "Bay State Road", 22))
165+
address(list("Tweakit", "Lem", "E"),
166+
list("Boston", "Bay State Road", 22))
166167
job(list("Tweakit", "Lem", "E"), list("computer", "technician"))
167168
salary(list("Tweakit", "Lem", "E"), 25000)
168169
supervisor(list("Tweakit", "Lem", "E"), list("Bitdiddle", "Ben"))
@@ -1060,10 +1061,12 @@ query_driver_loop();
10601061
</SCHEME>
10611062
<JAVASCRIPT>
10621063
and(job(list("Hacker", "Alyssa", "P"), list("computer", "programmer")),
1063-
address(list("Hacker", "Alyssa", "P"), list("Cambridge", "Mass Ave", 78)))
1064+
address(list("Hacker", "Alyssa", "P"),
1065+
list("Cambridge", "Mass Ave", 78)))
10641066

10651067
and(job(list("Fect", "Cy", "D"), list("computer", "programmer")),
1066-
address(list("Fect", "Cy", "D"), list("Cambridge", "Ames Street", 3)))
1068+
address(list("Fect", "Cy", "D"),
1069+
list("Cambridge", "Ames Street", 3)))
10671070
</JAVASCRIPT>
10681071
</SNIPPET>
10691072
</TEXT>
@@ -2084,7 +2087,7 @@ query_driver_loop();
20842087
</JAVASCRIPT_RUN>
20852088
<JAVASCRIPT_OUTPUT>
20862089
Query results:
2087-
append_to_form(list("a", "b"), list("c", "d"), list("a", "b", "c", "d"))
2090+
append_to_form(list("a","b"),list("c","d"),list("a","b","c","d"))
20882091
</JAVASCRIPT_OUTPUT>
20892092
</SNIPPET>
20902093
</TEXT>
@@ -2143,7 +2146,7 @@ query_driver_loop();
21432146
</JAVASCRIPT_RUN>
21442147
<JAVASCRIPT_OUTPUT>
21452148
Query results:
2146-
append_to_form(list("a", "b"), list("c", "d"), list("a", "b", "c", "d"))
2149+
append_to_form(list("a","b"),list("c","d"),list("a","b","c","d"))
21472150
</JAVASCRIPT_OUTPUT>
21482151
</SNIPPET>
21492152
</TEXT>
@@ -2201,11 +2204,11 @@ query_driver_loop();
22012204
</JAVASCRIPT_RUN>
22022205
<JAVASCRIPT_OUTPUT>
22032206
Query results:
2204-
append_to_form(null, list("a", "b", "c", "d"), list("a", "b", "c", "d"))
2205-
append_to_form(list("a"), list("b", "c", "d"), list("a", "b", "c", "d"))
2206-
append_to_form(list("a", "b"), list("c", "d"), list("a", "b", "c", "d"))
2207-
append_to_form(list("a", "b", "c"), list("d"), list("a", "b", "c", "d"))
2208-
append_to_form(list("a", "b", "c", "d"), null, list("a", "b", "c", "d"))
2207+
append_to_form(null,list("a","b","c","d"),list("a","b","c","d"))
2208+
append_to_form(list("a"),list("b","c","d"),list("a","b","c","d"))
2209+
append_to_form(list("a","b"),list("c","d"),list("a","b","c","d"))
2210+
append_to_form(list("a","b","c"),list("d"),list("a","b","c","d"))
2211+
append_to_form(list("a","b","c","d"),null,list("a","b","c","d"))
22092212
</JAVASCRIPT_OUTPUT>
22102213
</SNIPPET>
22112214
</TEXT>

xml/chapter4/section4/subsection3.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,15 +688,23 @@ accumulation_function($\textit{variable}$,
688688
</LI>
689689
<LI>
690690
Represent the fact about Irad, for example, as
691-
<JAVASCRIPTINLINE>related(list("great", "grandson"), "Adam", "Irad")</JAVASCRIPTINLINE>.
691+
<SNIPPET EVAL="no">
692+
<JAVASCRIPT>
693+
related(list("great", "grandson"), "Adam", "Irad")
694+
</JAVASCRIPT>
695+
</SNIPPET>
692696
</LI>
693697
<LI>
694698
Write rules that determine if a list ends in the word
695699
<JAVASCRIPTINLINE>"grandson"</JAVASCRIPTINLINE>.
696700
</LI>
697701
<LI>
698702
Use this to express a rule that allows one to derive the relationship
699-
<JAVASCRIPTINLINE>list(pair("great", rel), x, y)</JAVASCRIPTINLINE>,
703+
<SNIPPET EVAL="no">
704+
<JAVASCRIPT>
705+
list(pair("great", rel), x, y)
706+
</JAVASCRIPT>
707+
</SNIPPET>
700708
where <JAVASCRIPTINLINE>rel</JAVASCRIPTINLINE> is a list ending in
701709
<JAVASCRIPTINLINE>"grandson"</JAVASCRIPTINLINE>.
702710
</LI>

xml/chapter4/section4/subsection4.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,9 @@ function evaluate_query(query, frame_stream) {
489489
function simple_query(query_pattern, frame_stream) {
490490
return stream_flatmap(
491491
frame =>
492-
stream_append_delayed(find_assertions(query_pattern, frame),
493-
() => apply_rules(query_pattern, frame)),
492+
stream_append_delayed(
493+
find_assertions(query_pattern, frame),
494+
() => apply_rules(query_pattern, frame)),
494495
frame_stream);
495496
}
496497
</JAVASCRIPT>
@@ -3207,7 +3208,8 @@ function make_new_variable(variable, rule_application_id) {
32073208
<JAVASCRIPT>
32083209
function contract_question_mark(variable) {
32093210
return is_number(head(tail(variable)))
3210-
? head(tail(tail(variable))) + "_" + stringify(head(tail(variable)))
3211+
? head(tail(tail(variable))) +
3212+
"_" + stringify(head(tail(variable)))
32113213
: head(tail(variable));
32123214
}
32133215
function comma_separated(strings) {
@@ -3387,7 +3389,8 @@ function simple_query(query_pattern, frame_stream) {
33873389
function disjoin(disjuncts, frame_stream) {
33883390
return is_empty_disjunction(disjuncts)
33893391
? null
3390-
: interleave(evaluate_query(first_disjunct(disjuncts), frame_stream),
3392+
: interleave(evaluate_query(first_disjunct(disjuncts),
3393+
frame_stream),
33913394
disjoin(rest_disjuncts(disjuncts), frame_stream));
33923395
}
33933396
</JAVASCRIPT>

0 commit comments

Comments
 (0)