Advanced Tcl

Advanced Tcl is a guide for programmers who are beyond Beginning Tcl, and would really like to exploit some of the power of the Tcl language and/or the Tk Toolkit, here is a list of pages describing some advanced concepts.

See Also

Tcl Developer Guide
A guide to various aspectes of develping Tcl.


The Tcl Core
Tcl data types
Tcl Performance
Tcl Questions and Answers


Tcl style discussion

Tcl Facilities

Regular Expressions
Arrays / Hash Maps
String Processing
Variable Traces
when are they useful?
Serial Port
How to control a physical device


configuration files
command options
Techniques for processing the arguments to a command.
templates and macros

Builtin Extensions



Dangers of creative writing

Language Tricks

New Control Structures
Radical language modification
ever wanted to write i = 1?
Playing C
Salt and sugar
how to make Tcl code look nicer
Tcl Gems
code golf
Due to the emphasis on brevity, these exercises tend toward the dense side.

Design Patterns

Guarded proc
Meta Programming
Local procedures
How can I add a new option to an existing Tcl command?
How do I manage lock files in a cross platform manner in Tcl?
Data is code
Predicates: on being and having

Event-Driven Programming

Animations and Timing issues


Data files in Tcl
simple tricks to parse text files
Syntax parsing in Tcl
Simple tree layout

Inter-Process Communication

inter-process communication
Setting up lines of communications between processes.
message passing
Systems for interoperating over some IPC mechanism.

Object-Oriented Programming

Will's Guide to Creating Object Commands
Objects in Tcl
Curbside Collection for Object Systems
On things
Doing things
Doing things in namespaces
Chaining things
The Anatomy of an Object System
A modern take, in the spirit of Will's Guide to Creating Object Commands , on working with objects.

Functional Style

functional programming
Steps towards functional programming
Lambda in Tcl
Tail call optimization
linked lists


Sockets demonstration using an all-Tcl
Interacting with the internet
Interacting with databases

Distributing Software

What should I be sure to do so my Tcl based programs run cross platform

Administering tcl

Dynamic Libraries in Tcl

Extending Tcl

See Extending Tcl

Tk Concepts

Tk Performance
Entry Field Processing
Event Processing
Overloading a widget command
Poor Man's Drag-N-Drop
by Bryan Oakley
Geometry Managers
Practical Guide to Choosing Fonts
Grab Tips
for when you want to redirect events from one window to another
Option Database Tutorial
a great way of getting user-configurable and localizable applications
Adding User Data to Widgets the Megawidget Way
Tk image Dos and Don'ts
Cross Platform differences in Tcl/Tk


i18n - Writing for the world
Unicode and UTF-8
UTF-8 bit by bit
Encoding Translations and i18n
i18n tester
A little Unicode editor
A little Korean editor
Unicode file reader
The Lish family
converters from 7-bit ASCII to Arab/Cyrillic/Greek/Hebrew/Japanese/Korean.. Unicodes
Bag of number/time spellers
on the interface between people and numbers
Chinese numbers
Hebrew numbers
Roman numbers
Natural languages
Things British
Things Japanese
taiku goes multilingual
has links to almost a dozen translations of man Tcl into different languages

Old Skool

BASIC in Tcl
Playing Assembler
RPN in Tcl
reverse Polish notation

Other Languages

Playing Prolog
Playing Python
Playing C
Playing APL
Playing Smalltalk
Tcl and LISP
Playing Haskell
Turtle graphics the LOGO way
Unix shells
Eiffel-like Invariants
Design by Contract stuff.


99 bottles of beer
ANSI color control
Tcl/Tk games
Horseracing in Tcl
Model railroading with Tcl
Notes on a canvas
Postcard from Switzerland
Toy cars


Bag of algorithms
Bag of Tk algorithms
Bag of number/time spellers
Example scripts everybody should have
Tcl gems
When should Tcl/Tk/etc. NOT be used?
Halting Problem
Tk in a set-userid application
How do I report a bug in Tcl, Tk, ...?
Incr Tcl Design Patterns
dead link
Graph theory in Tcl
Searching A Star in Space
A multi-platform, fully automatic, live connection among graphical interface widgets and application variables for the python language.