ISBN: 0122612051 Tcl/Tk For Real Programmers: Errata

Despite the best efforts of a dozen proofreaders, a few glitches managed to slip into Tcl/Tk for Real Programmers. I apologise for letting these slip by me.

If you find a new error, please let me know, and you can be immortalized with the other careful readers.

  greenbar

Unclosed Socket

Petteri Kettunen points out that the POP3 example on P 74-76 doesn't close the socket when it's done.

The last lines in this example should be:


puts $popSock QUIT; 
flush $popSock
close $popSock

This will terminate the POP session, and then close the socket.

Extra field in text

In the middle of P123 is a line:

nodeID The node identifier

This line should not be present. There is no nodeID in the treeID.tree.Key name convention.

Wrong heading on example code

Example 5.5.2-1 should be titled TreeCreate, not TreeGetNameParts

extra bogus paragraph

The fourth paragraph on this page should have been deleted:

An entity identified as bar::baz represents an entity named baz that is a member of the namespace bar, which was created in the current scope...

The third paragraph on this page should be in that position:

An entity identified as foo::bar represents an entity named bar that exists in the namespace foo. The namespace foo is a child namespace in the current namespace.

namespace export exports procedure names, not variable names

Les Johnson noticed that on p. 185 I claim that the namespace export and namespace import commands will export both variables and procedures. My book is wrong. The man page and the source code both show that only procedure names are exported and imported.

Missing 'the'

On line 16, the phrase:

command, calling script can provide the name...

should read

command, the calling script can provide the name...

Missing Braces

Alexandre Ferrieux noticed that the example on P. 455, discussing when Tcl does the conversion between native and string format data should have a set of braces:

[expr {$x +  2}]

The discussion is accurate for an example with the braces. Without the braces, $x is replaced by the string value of x in the substitution phase before evaluating the expr command. This causes a native->string conversion to be done in the substitution phase before the expr command starts performing math (and converts the string back into a number.

Alex points out that arguments to expr should be placed in braces for efficiency. If the braces are left out the interpreter performs double conversions.

Missing Arguments

Andreas Kupries discovered that on P 612 I left out the procedure arguments in both the examples. They should read:

# Don't use this technique

proc initializeParameters {} {
   global height width linecolor
   set height 100
   set width 200 
   set linecolor blue
}
 
 
# Use this technique
proc initializeParameters {} {
   global globalParams
   set globalParams(height) 100
   set globalParams(width) 200 
   set globalParams(linecolor) blue
}
 

Incr Tcl Install Instructions

Jan Nijtmans informs me that despite my claims, his img11p3.exe package will not install [incr Tcl].

The file itcl22.exe (in the incr_tcl subdirectory will install [incr Tcl], while the img11p3.exe file (in the img subdirectory) will install Jan's img extension.

Purchasing Tcl/Tk For Real Programmers

You can order Tcl/Tk For Real Programmers from Amazon Books, enjoy Amazon's low prices, and have the book shipped to your door by clicking the Buy button to the left.
Amazon is offering Tcl/Tk For Real Programmers at a 20 % discount

  greenbar

Return to Clif Flynts Home Page