This page reflects errors that were found in the the 3rd edition of the book. If you found an error that is not listed here, please send me a note at [email protected] and mention that you did not see it here.
Last update Tue Apr 15 11:28:42 PDT 2003
p11 | Font error on the second use of "return command" in the
second to last paragraph. |
p16 | lose is misspelled as loose right after the Hot Tip icon. |
p23 | The cross reference to join should be to p. 67 (not 65),
and the reference to lappend should be to p. 62 (not 61). |
p46 | Font error on string map table entry (charMap, string) |
p51 | In-line examples of string map have incorrect argument order: the string "food" should be the last argument |
p61 | Example 5-1 uses backslashes to quote braces unnecessarily. The backslashes are not needed because the braces are inside a group formed with double quotes; the braces have no special meaning in this context. The overall point of the example is still valid - use the list command to construct lists instead of quoting by hand. But, the last set command in the example can be written like this and still have $x substituted:
set l2 "{$x} {a b} $y" |
p83 | The first paragraph of the Scope section references Chapter 7 for namespaces, when it should reference Chapter 14. |
p131 | Example 10-5 should gets from $in not $file |
p133 | Hindu, which is the religion, should be Hindi, which is the language. |
p140 | The example that uses [:space:] should be written [[:space:]] because this syntax is only valid inside a bracketed expression. |
p150 | Example 11-3 lists the match variables incorrectly. The command should be:regexp {([^:]+)://([^:/]+)(:([0-9]+))?(/.*)} $url \ match protocol server x port path |
p151 | Example 11-4 mixes greedy and non-greedy matches,
which Tcl makes all into non-greedy because it sees that first :-(.
You have to force the last greedy match to go all the way to the end of
the string with the $ anchor:regexp {(.+?)://(.+?)(?::([0-9]+))?(/.*)$} $url \ match protocol server port path |
p151 |
Table 11-7, the fourth pattern should be non-greedy to work the same as the third pattern. It should be:
{^\S+?:} |
p154 | Example 11-5 program listing for proc Url_Decode has a missing open square bracket. Line 3 should contain:
[[:xdigit:]] |
p155 | The example title for 11-6 is incorrect, should name the Cgi_List and Cgi_Query procedures. |
p164 | Cross reference to Chapter 37 should be to Chapter 44. |
p175 | The %W clock format has a range of 00-52, not 01-52 |
p184 | Example 13-8 should use uplevel when creating its traces:
uplevel 1 [list trace variable $varName wu ReadOnlyTrace] |
p210 | "fewer" than 128 should probably be "less" than 128 in the discussion about UTF-8 and character codes. |
p227 | Example 17-1. This procedure leaves the fileevent active. After the vwait you ought to disable the file event:
fileevent $sock w {set connected ok} vwait connected fileevent $sock w {} |
p230 | Example 17-5 has the second + sign out of place
in the regular expression.
The regexp command should beregexp -nocase {^(http://)?([^:/]+)(:([0-9]+))?(/.*)} \ $url x protocol server y port path |
p231 | Example 17-6 has the same bug as Example 17-5 |
p246 | Replace /request with /page at the end of the first paragraph. |
p250 | Example 18-4 should call Httpd_ReturnData with $contents instead of $data |
p258 | Example 18-14 has a stray trailing double-quote on addr2" |
p404 | Example 27-14. It is better to use the menu's "invoke" operation than using the command directly. This correctly handles updating the checkbutton or ratiobutton variable. Oliver Bienert contributed this version that has this fix, checks the state of the menu, and takes an explicit accelerator string:
proc Menu_Bind { what sequence accText menuName label } { variable menu set m [MenuGet $menuName] if [catch {$m index $label} index] { error "$label not in menu $menuName" } set state [$m entrycget $index -state] if [string equal $state normal] { set command [list $m invoke $index] } else { set command {} } bind $what $sequence $command $m entryconfigure $index -accelerator $accText } |
p436 | Example 31-1. The graphic doesn't have "Address1" and "Address2" labels, which is what would be produced by the foreach loop in the example. You could get the display either with an if test for the field name, or by having two loop variables: one for the array index and one for the label. |
p453 | Bottom of the page. The => comparison operator should be >= |
p456 | Last sentence. Delete "is" from "The example is uses the font naming system..." |
p495 | Table 34-11 is missing the overlapping spec for the find and addtag canvas operations. It takes x1 y1 x2 y2 that specify a bounding box, and returns the item IDs of those objects that overlap that box. |
p573 | The double-quotes around the wm command argument do not account for $argv0 values with spaces. A better solution iswm command . [linsert $argv 0 $argv0] |
p610 | The in-line example that summarizes the Tcl_CreateCommand calling sequence is wrong. It should be:Tcl_CreateCommand(interp, "cmd", CmdProc, data, DeleteProc); |
p617 | There is no Tcl_GetListFromObj function. Replace all occurrences with:Tcl_ListObjGetElements(interp, objv[1], &objc, &listv);There is also the use of Tcl_GetInFromObj in the paragraph text that should be Tcl_GetIntFromObj. |
p620 | The explanation of Tcl_Alloc vs. ckalloc is not right. If you are writing code for the core of Tcl and Tk, you should always use ckalloc and ckfree. If you are writing extensions, you can also use ckalloc and ckfree, and then control their effect with the TCL_MEM_DEBUG compile time flag. If you never use TCL_MEM_DEBUG, then you can stick with Tcl_Alloc and Tcl_Free. |
p665 | Example 46-8. Just before the end of the for (error) loop there needs to be a break; statement so the loop terminates correctly without error. |
p680 | Under Evaluating Tcl Commands, there should be a reference to "Tcl_RecordAndEval or Tcl_RecordAndEvalObj". |
p729 | The reference to binhex should be to macintosh/binhex |
p730 | It should be port 8015, not part 8015. |