diff --git a/xml/chapter3/section3/subsection1.xml b/xml/chapter3/section3/subsection1.xml index 4a219a588..3820d0a4e 100644 --- a/xml/chapter3/section3/subsection1.xml +++ b/xml/chapter3/section3/subsection1.xml @@ -1441,6 +1441,7 @@ set_to_wow(z2); function + count_pairs count_pairs (define (count-pairs x) @@ -1476,18 +1477,18 @@ function count_pairs(x) { exercise_3_16_solution + count_pairs exercise_3_16_solution_example -const cycle = make_cycle(three_list); - const three_list = list("a", "b", "c"); - -const one = pair("a", "b"); -const three = pair(one, one); -const four = pair(three, "c"); -const seven = pair(three, three); +const one = pair("d", "e"); +const two = pair(one, one); +const four_list = pair(two, "f"); +const seven_list = pair(two, two); +const cycle = list("g", "h", "i"); +set_tail(tail(tail(cycle)), cycle); @@ -1496,8 +1497,8 @@ const seven = pair(three, three); // return 3; return 4; return 7; display(count_pairs(three_list)); -display(count_pairs(four)); -display(count_pairs(seven)); +display(count_pairs(four_list)); +display(count_pairs(seven_list)); // never return at all display(count_pairs(cycle));