Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errata to the first printing by MIT Press #733

Open
martin-henz opened this issue Dec 13, 2021 · 11 comments
Open

Errata to the first printing by MIT Press #733

martin-henz opened this issue Dec 13, 2021 · 11 comments
Labels

Comments

@martin-henz
Copy link
Member

martin-henz commented Dec 13, 2021

This issue collects the errata of the print edition of SICP JS (print 2022):

  • 4.1.5, page 351 (top): Extra semicolon in function strange:
function strange(f) {
    return halts(f, f)
           ? run_forever();
           : "halted";
}

should be

function strange(f) {
    return halts(f, f)
           ? run_forever()
           : "halted";
}

fixed in online edition; fix is PR #747.

@martin-henz martin-henz changed the title ERRATA Errata to the First Printing by MIT Press Dec 14, 2021
@martin-henz martin-henz changed the title Errata to the First Printing by MIT Press Errata to the first printing by MIT Press Dec 14, 2021
@martin-henz
Copy link
Member Author

martin-henz commented Aug 27, 2022

  • 3.2.4, page 220, exercise 3.11, function dispatch:
               : "Unknown request: make_account";

should be

               : error(m, "Unknown request: make_account");

to make more sense and to be in line with SICP.

fixed in online edition; fix is PR #798.

@martin-henz
Copy link
Member Author

  • 2.2.1, page 90, typo in second line from top:
one at at time

should be

one at a time

Fixed in online edition; fix is PR #778.

@martin-henz
Copy link
Member Author

martin-henz commented Aug 28, 2022

  • 2.1.3, page 80, line 5:
(an efficient implementation of pairs might use JavaScript’s primitive vector data structure)

should be

(an efficient implementation of pairs might use JavaScript’s native vector data structure)

The issue is discussed in #756.

Fixed in 489637f

@martin-henz
Copy link
Member Author

2.2.3, page 105, last function of Exercise 2.37:

function matrix_times_matrix(n, m) {

should be

function matrix_times_matrix(n, m) {

The issue is discussed in #831.

Fixed in #1027.

@martin-henz
Copy link
Member Author

3.5.1, page 322, middle of the page:

pair(head(stream), 
     stream_filter(pred, stream_tail(stream)));

should be

pair(head(stream), 
     () => stream_filter(pred, stream_tail(stream)));

as in SICP (using cons-stream).

The issue is discussed in #839.

Fixed in #1028.

@martin-henz
Copy link
Member Author

martin-henz commented Jul 1, 2024

1.1.6, page 15, the first two bullet points in the middle of the page:

e1 && e2 is syntactic sugar for e1 ? e2 : false, and e1 || e2 is syntactic sugar for e1 ? true : e2. Strictly speaking, in JavaScript, e1 && e2 is syntactic sugar for e1 ? e2 : e1 and e1 || e2 is syntactic sugar for e1 ? e1 : e2.

Direct link to the relevant portion of the language specification: https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-binary-logical-operators-runtime-semantics-evaluation

Solution: Weaken the phrasing to:

"We assume16 this syntactic form to be syntactic sugar for
expression1​ ? true : expression2."
and add a clarifying footnote
"16 This assumption is justified by the restriction mentioned in footnote 14. Full JavaScript needs to consider the case where the result of evaluating expression11​ is neither true nor false."

The issue is discussed in #776.

Fixed in #1033.

@martin-henz
Copy link
Member Author

References, pages 566, 568, 570, page headers:

The headers say "Chapter 5 References", but these are the references for the whole book.

The issue is discussed in #889.

Fixed in #1039.

@martin-henz
Copy link
Member Author

Several places in 2.4.2, 2.4.3, and 2.5.2: math_atan was used instead of math_atan2.

The issue is discussed in #1006.

Fixed in #1041.

@martin-henz
Copy link
Member Author

3.3.3, page 238, function insert.
Wrong:

const record = assoc(key_2, tail(table));

Right:

const record = assoc(key_2, tail(subtable));

The issue is discussed in #1000.

Fixed in #1043.

@martin-henz
Copy link
Member Author

martin-henz commented Jul 1, 2024

1.2.6, page 46. Inconsistent exercise.

The question makes use of a function report_prime that returns undefined. As a result, the given function start_prime_test either returns undefined or true. This makes it awkward to use the given setup in a solution, because undefined hasn't been properly introduced at this point. Instead of undefined, report_prime should return true. Then start_prime_test should be changed so that it returns true for primes and false for non-primes. That will allow for a solution that doesn't need to deal with undefined.

The issue is discussed in #973.

Fixed in #1045.

@martin-henz
Copy link
Member Author

3.5.2, page 294, Exercise 3.60, second line, currently says

is implemented by add-streams

but should say

is implemented by add_streams

The issue is raised in #1048.

Fixed in #1049.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant