erjablow (9) [Avatar] Offline
#1
There is a nearly trivial misprint in the unnumbered code example on p. 87, sec. 3.2.4 of my printing (the 6th). The first three lines read:

var MODE_RED=1;
var MODE_AMBER=2;
var MODE_GREEN=2;

This seems like an invitation to a bad traffic accident. I suggest changing the second 2 to 3. For pedagogical purposes, you can write it as

var MODE_RED = 1;
var MODE_AMBER = MODE_RED + 1;
var MODE_GREEN = MODE_AMBER + 1;