The corrected version of this edition is available on-line. This contains several error fixesplease use that version rather than this one.
"How to Design Programs" contains the following mistakes:
The problem statement correctly specifies that "[d]ecreasing the price by a dime ($.10) increases attendance by 15." Later, the book includes the sentence "The base attendance at a price of five dollars is 120, and for each 15 cents less than five dollars, 10 more attendees show up." This second claim is incorrect.
Thanks to Chuck Floyd, Kerrville, TX
The book specifies that
;;A shape is either ;;1. a circle, or ;;2. a structure.This should be
;;A shape is either ;;1. a circle, or ;;2. a square.
Thanks to Jamie Raymond, Houston, TX
The book mistakenly specifies random as a function that
consumes a natural number. Instead, random consumes an integer
greater than or equal to 1 (and less than or equal to 2147483647.
Thanks to Marvin D. Hernandez, Miami, FL
The section switches from the development of a descending sort to that
of an ascending sort during the transition from the development of
sort to the development of insert.
Figure 33 (page 175) should be as follows:
;; |
Thanks to Daniel P. Friedman, Bloomington, IN
"make-structure" should be "make-mail".
(make-child empty empty 'Bettina 1950 'green) | should be | (make-child empty empty 'Bettina 1926 'green) |
(make-child (make-child empty empty 'Carl 1926 'green)
(make-child empty empty 'Bettina 1950 'green)
'Adam
1950
'yellow)
| should be |
(make-child (make-child empty empty 'Carl 1926 'green)
(make-child empty empty 'Bettina 1926 'green)
'Adam
1950
'yellow)
|
(make-child (make-child empty empty 'Carl 1926 'green)
(make-child empty empty 'Bettina 1950 'green)
'Dave
1955
'black)
| should be |
(make-child (make-child empty empty 'Carl 1926 'green)
(make-child empty empty 'Bettina 1926 'green)
'Dave
1955
'black)
|
Thanks to Marvin D. Hernandez, Miami, FL
;; blue-eyed-descendant? : ftn -> boolean ;; to determine whethershould bea-parentany of the descendants (children, ;; grandchildren, and so on) have'bluein theeyesfield (define (blue-eyed-descendant? a-parent) ...)
;; blue-eyed-descendant? : parent -> boolean ;; to determine whethera-parentany of the descendants (children, ;; grandchildren, and so on) have'bluein theeyesfield (define (blue-eyed-descendant? a-parent) ...)
Thanks to Marvin D. Hernandez, Miami, FL
The enumerations are missing a number each. Here are the correct versions:
1. 18 is evenly divisible by 1, 2, 3, 6, 9, and 18; 2. 24 is evenly divisible by 1, 2, 3, 4, 6, 8, 12, and 24.
Thanks to Daniel P. Friedman, Bloomington, IN
The application of make-last-item in invert
receives the arguments in the wrong order:
(define (invert alox)
(cond
[(empty? alox) empty]
[else (make-last-item (first alox) (invert (rest alox)))]))
|
Thanks to Daniel P. Friedman, Bloomington, IN
Figure 81 contains a mistake in the definition of
vector-sum. Here is the correct version:
;; |
Thanks to Nguyen Cong Vu, Open University, Ho Chi Minh City, Viet Nam
In exercise 38.4.3, part 3 the program is illegal in Advanced Scheme. Here is the corrected version:
(define (make-box x)
(local ((define contents x)
(define (new y)
(set! contents y))
(define (peek)
contents))
(list new peek))
newline
(define B (make-box 55))
(define C (make-box 'a))
newline
(begin
((first B) 33)
((second C)))
|
Thanks to Dung X. Nguyen, Houston, TX.
The two pictures of dots on a line were unreadable due to the HTML converter.
We have also found the following typos:
chosen-word
but to use '_ as the letters."
should be
"Thus, the matching action is to build a word as long as
chosen-word from '_.
(D.P. Friedman)
chosen-wor
should be
chosen-word
(D.P. Friedman)
(sorted-insert! 1 CLUBS hand0)
should be
(sorted-insert! 2 CLUBS hand0)
(D.P. Friedman)