3rd Edition

A Developer's Guide

Authors: Clif Flynt
Paperback ISBN: 9780123847171
eBook ISBN: 9780123847188
Imprint: Morgan Kaufmann
Published Date: 7th February 2012
Page Count: 816
Tax/VAT will be calculated at check-out
Compatible Not compatible
VitalSource PC, Mac, iPhone & iPad Amazon Kindle eReader
ePub & PDF Apple & PC desktop. Mobile devices (Apple & Android) Amazon Kindle eReader
Mobi Amazon Kindle eReader Anything else

Institutional Access

Table of Contents





Chapter 1. Tcl/Tk Features

1.1 Tcl Overview

1.2 Tcl As a Glue Language

1.3 Tcl As a General-Purpose Interpreter

1.4 Tcl As an Extensible Interpreter

1.5 Tcl As an Embeddable Interpreter

1.6 Tcl As a Rapid Development Tool

1.7 GUI-Based Programming

1.8 Shipping Products

1.9 Bottom Line

1.10 Problems

Chapter 2. The Mechanics of Using the Tcl and Tk Interpreters

2.1 The tclsh and wish Interpreters

2.2 Using tclsh/wish Interactively

2.3 Evaluating Tcl Script Files

2.4 Bottom Line

2.5 Problems

Chapter 3. Introduction to the Tcl Language

3.1 Overview of the Basics

3.2 Command Evaluation and Substitutions

3.3 Data Types

3.4 Arithmetic and Boolean Operations

3.5 Modularization

3.6 Bottom Line

3.7 Problems

Chapter 4. Navigating the File System, Basic I/O and Sockets

4.1 Navigating the File System

4.2 Properties of File System Items

4.3 Removing Files

4.4 Input/Output in TCL

4.5 Sockets

4.6 Bottom Line

4.7 Problems

Chapter 5. Using Strings and Lists

5.1 Converting a String into a List

5.2 Examining the List with a for Loop

5.3 Using the foreach Command

5.4 Using string match Instead of string first

5.5 Using lsearch

5.6 The regexp Command

5.7 Creating a Procedure

5.8 Making a Script

5.9 Speed

5.10 Bottom Line

5.11 Problems

Chapter 6. Complex Data Structures with Lists, Arrays and Dicts

6.1 Using the Tcl List

6.2 Using the Dict

6.3 Using the Associative Array

6.4 Trees in Tcl

6.5 Tcl and SQL

6.6 Performance

6.7 Bottom Line

6.8 Problems

Chapter 7. Procedure Techniques

7.1 Arguments to Procedures

7.2 Renaming or Deleti


Newly updated with over 150 pages of material on the latest Tcl extensions, Tcl/Tk: A Developer’s Guide is a unique practical tutorial for professional programmers and beginners alike. Starting with a clear picture of the basics, Tcl/Tk covers the variety of tools in this "Swiss army knife" of programming languages, giving you the ability to enhance your programs, extend your application's capabilities, and become a more effective programmer.

This updated edition covers all of the new features of version 8.6, including object-oriented programming and the creation of megawidgets, existing data structure implementations, themed widgets and virtual events. Extensive code snippets and online tutorials in various languages will give you a firm grasp on how to use the Tcl/Tk libraries and interpreters and, most importantly, on what constitutes an effective strategy for using Tcl/Tk.

Key Features

  • Includes the latest features of Tcl/Tk 8.6
  • Covers Tcl development tools, popular extensions, and packages to allow developers to solve real-world problems with Tcl/Tk immediately
  • Provides straightforward explanations for beginners and offers tips, style guidelines, and debugging techniques for advanced users
  • Companion website includes Tcl/Tk tutorials, applications, distributions, and more tools


Applications developers, programmers, software testers, systems software engineers, software architects, and design engineers


No. of pages:
© Morgan Kaufmann 2012
Morgan Kaufmann
eBook ISBN:
Paperback ISBN:


"The best computer programmers are astonishingly more productive than average. One reason is that they use good tools, and they use them well. Clif Flynt's Tcl/Tk: A Developer's Guide, Second Edition helps you improve your effectiveness as a developer in both of these ways. Tcl is a software language with a great return on investment—it achieves portable, powerful, economical results with great economy. Just a few lines of Tcl are enough to create applications that are both interesting and useful. Clif draws on his deep experience as a front-line developer to help you get the most out of Tcl. He writes clearly, and has organized his book with instructive examples that teach the essentials of Tcl. He covers the right material too: Tcl/Tk packs in not just such long-standing Tcl strengths such as its easy networking and graphical user interface, but also the latest breakthroughs with internationalization, widget upgrades, and StarPacks. Want to take your programming to the next level? Get Tcl/Tk: A Developer's Guide, Second Edition."

—Cameron Laird is vice president of Phaseit, Inc. (, where he specializes in Rapid Enterprise Integration with Tcl and related tools. His frequent publications on information technology include the popular "Regular Expressions" column (

About the Authors

Clif Flynt Author

Clif Flynt is a professional programmer and has been a Tcl advocate since 1994. He has developed Tcl applications for the e-commerce, factory control, computer-based education, network analysis, games, firewall configuration, systems administration, and more. He has taught Tcl/Tk seminars in colleges and corporations around the world and writes regularly on Tcl/Tk for the developer community.

Affiliations and Expertise

CEO, Noumena Corporation, Dexter, Michigan