Skip to content

Commit 3197eb5

Browse files
authored
space after commas added (#682)
* space in function times added * more spaces missing
1 parent f064d4b commit 3197eb5

File tree

15 files changed

+34
-34
lines changed

15 files changed

+34
-34
lines changed

xml/chapter1/section2/subsection2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ function pascal_triangle(row, index) {
698698
<REQUIRES>pascal_triangle</REQUIRES>
699699
<EXPECTED>4</EXPECTED>
700700
<JAVASCRIPT>
701-
pascal_triangle(5,4);
701+
pascal_triangle(5, 4);
702702
</JAVASCRIPT>
703703
<SCHEME>
704704
</SCHEME>

xml/chapter1/section2/subsection4.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ fast_expt(2, 3);
369369
(+ a (* a (- b 1)))))
370370
</SCHEME>
371371
<JAVASCRIPT>
372-
function times(a,b) {
372+
function times(a, b) {
373373
return b === 0
374374
? 0
375375
: a + times(a, b - 1);

xml/chapter2/section1/subsection2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ function make_point(x, y) {
349349
return pair(x, y);
350350
}
351351
function make_segment(start_point, end_point) {
352-
return pair(start_point,end_point);
352+
return pair(start_point, end_point);
353353
}
354354
function start_segment(x) {
355355
return head(x);

xml/chapter2/section1/subsection3.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<SPLITINLINE>
6969
<SCHEME><SCHEMEINLINE>(make-rat n d)</SCHEMEINLINE>,</SCHEME>
7070
<JAVASCRIPT>
71-
<JAVASCRIPTINLINE>make_rat(n,d)</JAVASCRIPTINLINE>,
71+
<JAVASCRIPTINLINE>make_rat(n, d)</JAVASCRIPTINLINE>,
7272
</JAVASCRIPT>
7373
</SPLITINLINE>
7474
then
@@ -546,7 +546,7 @@ function head(z) {
546546
<EXAMPLE>cons_1_2_run_2</EXAMPLE>
547547
<JAVASCRIPT>
548548
function tail(z) {
549-
return z((p,q) => q);
549+
return z((p, q) => q);
550550
}
551551
</JAVASCRIPT>
552552
<SCHEME>

xml/chapter2/section1/subsection4.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,14 +632,14 @@ function par2(r1, r2) {
632632
<SNIPPET HIDE="yes">
633633
<NAME>par_example</NAME>
634634
<JAVASCRIPT>
635-
display(print_interval(par1(pair(4,6), pair(7,8))));
635+
display(print_interval(par1(pair(4, 6), pair(7, 8))));
636636

637-
display(print_interval(par2(pair(4,6), pair(7,8))));
637+
display(print_interval(par2(pair(4, 6), pair(7, 8))));
638638
</JAVASCRIPT>
639639
<JAVASCRIPT_TEST>
640-
print_interval(par1(pair(4,6), pair(7,8)))
640+
print_interval(par1(pair(4, 6), pair(7, 8)))
641641
+
642-
print_interval(par2(pair(4,6), pair(7,8)));
642+
print_interval(par2(pair(4, 6), pair(7, 8)));
643643
</JAVASCRIPT_TEST>
644644
</SNIPPET>
645645
Lem complains that Alyssa<APOS/>s program gives different answers for

xml/chapter2/section3/subsection3.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ function union_set(set1, set2) {
576576
(else (element-of-set? x (cdr set)))))
577577
</SCHEME>
578578
<JAVASCRIPT>
579-
function is_element_of_set(x,set) {
579+
function is_element_of_set(x, set) {
580580
return is_null(set)
581581
? false
582582
: x === head(set)
@@ -925,7 +925,7 @@ function left_branch(tree) { return head(tail(tree)); }
925925
function right_branch(tree) { return head(tail(tail(tree))); }
926926
<SHORT_SPACE/>
927927
function make_tree(entry, left, right) {
928-
return list(entry,left,right);
928+
return list(entry, left, right);
929929
}
930930
</JAVASCRIPT>
931931
</SNIPPET>
@@ -950,7 +950,7 @@ entry(
950950
make_tree(10,
951951
null,
952952
make_tree(30,
953-
make_tree(20,null,null),
953+
make_tree(20, null, null),
954954
null)))));
955955
</JAVASCRIPT>
956956
</SNIPPET>
@@ -1052,7 +1052,7 @@ head(tail(head(tail(adjoin_set(10, adjoin_set(15, adjoin_set(20, null)))))));
10521052
(adjoin-set x (right-branch set))))))
10531053
</SCHEME>
10541054
<JAVASCRIPT>
1055-
function adjoin_set(x,set) {
1055+
function adjoin_set(x, set) {
10561056
return is_null(set)
10571057
? make_tree(x, null, null)
10581058
: x === entry(set)
@@ -1339,11 +1339,11 @@ function tree_to_list_2(tree) {
13391339
</SCHEME>
13401340
<JAVASCRIPT>
13411341
function list_to_tree(elements) {
1342-
return head(partial_tree(elements,length(elements)));
1342+
return head(partial_tree(elements, length(elements)));
13431343
}
13441344
function partial_tree(elts, n) {
13451345
if (n === 0) {
1346-
return pair(null,elts);
1346+
return pair(null, elts);
13471347
} else {
13481348
const left_size = math_floor((n - 1) / 2);
13491349
const left_result = partial_tree(elts, left_size);

xml/chapter2/section3/subsection4.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ weight_leaf(my_leaf);
404404
(+ (weight left) (weight right))))
405405
</SCHEME>
406406
<JAVASCRIPT>
407-
function make_code_tree(left,right) {
407+
function make_code_tree(left, right) {
408408
return list("code_tree", left, right,
409409
append(symbols(left), symbols(right)),
410410
weight(left) + weight(right));

xml/chapter2/section4/subsection1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
(make-from-real-imag (real-part z) (imag-part z))
135135
</SCHEME>
136136
<JAVASCRIPT>
137-
make_from_real_imag(real_part(z),imag_part(z));
137+
make_from_real_imag(real_part(z), imag_part(z));
138138
</JAVASCRIPT>
139139
</SNIPPET>
140140
and

xml/chapter2/section5/subsection1.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -736,17 +736,17 @@ apply_generic("magnitude", list(z));
736736
// put("magnitude", list("complex"), magnitude);
737737
// fun = magnitude;
738738
apply(magnitude, map(contents, list(z)));
739-
apply(magnitude, pair("rectangular", pair(3,4)));
740-
magnitude(pair("rectangular"), pair(3,4));
741-
apply_generic("magnitude", list(pair("rectangular"), pair(3,4)));
739+
apply(magnitude, pair("rectangular", pair(3, 4)));
740+
magnitude(pair("rectangular"), pair(3, 4));
741+
apply_generic("magnitude", list(pair("rectangular"), pair(3, 4)));
742742
// type_tags = map(type_tag, list(z)) evaluates to list("rectangular")
743743
// fun = get("magnitude", list("rectangular")) which evaluates to
744744
// z => math_sqrt(square(real_part(z)) + square(imag_part(z)))
745745
// z => math_sqrt(square(head(z)) + square(tail(z)))
746-
apply(fun, map(contents, list(pair("rectangular"), pair(3,4))))
747-
apply(fun, pair(3,4))
748-
(z => math_sqrt(square(head(z)) + square(tail(z))))(pair(3,4));
749-
math_sqrt(square(head(pair(3,4))) + square(tail(pair(3,4))))
746+
apply(fun, map(contents, list(pair("rectangular"), pair(3, 4))))
747+
apply(fun, pair(3, 4))
748+
(z => math_sqrt(square(head(z)) + square(tail(z))))(pair(3, 4));
749+
math_sqrt(square(head(pair(3, 4))) + square(tail(pair(3, 4))))
750750
...
751751
math_sqrt(square(3) + square(4));
752752
...

xml/chapter3/section1/subsection3.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,15 +802,15 @@ paul_acc("withdraw")(50);
802802
</SCHEME>
803803
<JAVASCRIPT>
804804
function factorial(n) {
805-
function iter(product,counter) {
805+
function iter(product, counter) {
806806
if (counter &gt; n) {
807807
return product;
808808
} else {
809-
return iter(counter*product,
810-
counter+1);
809+
return iter(counter * product,
810+
counter + 1);
811811
}
812812
}
813-
return iter(1,1);
813+
return iter(1, 1);
814814
}
815815
</JAVASCRIPT>
816816
</SNIPPET>

0 commit comments

Comments
 (0)