Advertisement
Membership
Login
ACCU Buttons
Search in Book Reviews
Search is a simple string search in either book title or book author. The full text search is a search of the text of the review.
What are Tcl and Tk? Tcl is a scripting language, like so many others. But what sets it apart is the ability to add a Tcl interpreter to your applications. Tcl acts like glue between applications. 'Tcl fills the role of an extension language that is used to configure and customise applications.' Editors and terminal emulators have been written in Tcl. Tk is its graphical manifestation. Something the author appears to have missedis that Tcl/Tk seems to have found a new open source home on ActiveState (seehttp://www.activestate.com/initiatives/tcl.html).
Amongst the code I did find the occasional error, but these were all
flagged up on the author's web site (http://www.beedub.com/). He uses some very
neat, though not original, tricks to fox the OS into executing long
path names in running the shell (he uses extended comments to do this
- fascinating) and this (page 17) to comment out large sections of code
if {0} {unused code goes here
}
A trick like this could be used in many languages.
Welch covers Tcl right up to version 8.3. It is not a book of general interest and will appeal only to those closely involved (or about to be) in Tcl coding or to those who wish to dabble (in UNIX GUI prototyping for example).
Of particular interest to readers of these columns is his treatment of the Tcl in C programming. Here he explains that there are two basic approaches; 1. write extensions to add commands to the standard Tcl shell and 2. add the Tcl library to an existing application. The first one is the easiest. Chapter 44 treats both the original string based command interface and the version now available in 8.0, which is a more efficient dual-ported object interface. This is not for the lighthearted. All the examples are in pure C, not C++ and at times I was struggling to see the shape of an overall (main) example as distinct from numerous libraries.
This section on C programming is clear and well done. Welch points the reader to David Beasley's SWIG which generates C code to implement command procedures, exposing C and C++ APIs as Tcl commands.
The index is good and he makes reference to numerous web sites and news groups. Regular expressions, an essential part of any scripting language, are well treated.