Frequently Made Mistakes™ in Tcl

Selected by PC Webopaedia

Table of Contents


Purpose of this article

This article categorizes two kinds of mistakes: evident faults, where a programmer knows he or she isn't getting the result he or she wants; and unidiomatic usages, in which functionality is at least superficially acceptable, but potentially compromised because it doesn't partake of the Tao of Tcl. In 1999, I'm also working on a section of underappreciated benefits of Tcl.

In 2001, I moved much of the material here to a variety of individual pages within the Tcl-ers' Wiki. Now, for the most part, I update the Wiki pages specific to a particular construct, and this FMM page, which aimed to span the confusions of a breadth of different commands, is mostly dormant. If you find this page helpful, I strongly urge you to give that resource--the Wiki--a bit of your attention.

In 2007, I continue to maintain this rather passively: updating it whenever someone raises a point, and occasionally adding new material, but mostly relying on the Wiki to accumulate community wisdom.

Format of this article

[Explain index. Explain format.] [Segment into Tcl- and Tk-specific?]


Gerry Snyder, for example, finds this "... a very valuable resource".

The mistakes

Evident faults

False Tcl idioms

Those cultivating good Tcl style will want to read the FAQs, guides, and analyses I've collected.

Underappreciated benefits

Someone might code Tcl correctly, in the sense of being without formal errors, yet derivatively. If your Tcl source looks like Perl or Pascal, you're probably missing out on the best the language has to offer. This section explains the unique ideas that differentiate Tcl from other languages, and make for the best Tcl programming.



Event model


Code-data duality

[Explain gluing--especially two-way pipes--event model (compare with IO::Multiplex), traces, and simplicity. Also emptiness, manifold technology.]

About this article




MUCH richer cross-references; tightened writing; reader responses; ...

It's ENORMOUSLY helpful to hear from readers about whether and how this article benefits them. I'm excited about the possibility that careful cross-referencing can make this article particularly useful as a tutorial. Another live question for me now has to do with the scale of this article; I suspect it's just a bit large to be comprehended easily, and deserves a re-write which will pare down its top-level size. Reactions, anyone?


Thanks to Andreas Kupries, Laurent Duperval, Peter A Fletcher, Pascal Bouvier, (Mike Hopkirk),, Alex Martelli <>, Ross J. Reedstrom <>, Hume Smith, and for a variety of suggestions and criticisms. Special thanks to Larry Virden, who has promoted the success of this page over and over, and Jeffrey Hobbs, who injects large volumes of de-mystification into comp.lang.tcl. Chris Nelson and Jim Graham drafted a few of the entries. Chris has also constructively criticized many of them. Jean-Claude Wippler claims this page should be glossed as "Fascinating Mistake Monitor".

Master copy

The current version of this document has a permanent home at


Cameron Laird's notes on mistakes frequently made by newcomers to Tcl/
=0} { puts "== $line ==" } -->