Version 77 of incr Tcl

Updated 2009-09-12 22:06:34 by MartinCleaver

[incr Tcl] is the standard OO system for Tcl.

The name is a play on C++, and [incr Tcl] provides a similar object model, including multiple inheritance, and public and private classes and variables.

Between 1995 and 2008 there were over a dozen OO extensions for Tcl: [incr Tcl] eventually won as the community recognised that the consolidating OO systems would permit the community to focus energies and gain strength.

From Tcl 8.x itcl was revamped in an initiative called itcl-ng using the tclOO mechanisms. This is detail as it maintains the same itcl programmer interface.

Getting Incr Tcl

[incr Tcl] is a component of some batteries included Tcl distributions, such as Tcl Dev Kit, ActiveTcl, Tclkit and dqkit.

Widget Sets

[incr Tcl] is also the foundation of [incr Tk] and the Iwidgets megawidgets. The home page is , and source code is available at

Script level commands in the itcl extension

Why use itcl?

Marty Backe posted an apt testimonial to comp.lang.tcl: "I've been using Iwidgets for awhile now, and recently completed a project that was fully implemented in itcl (including Iwidgets). I'm converted. Once you write a program based on objects, you might be hard pressed to go back to the straight tcl way. It becomes VERY easyto write clear, concise code. Of course you can do the same with namespaces (that's what I've been doing), but it takes a lot more work, and the result isn't as satisfying (IMHO).

My current approach is to have one file that contains the main application, which primarily creates objects via class files sourced from a class/ directory. Each object is defined in one class file. This facilitates testing of the objects prior to integration into the application.

Arguably, Itcl is probably one of the most mature extensions available for Tcl. I think that should be your least concern.

Add on classes for incr tcl


See Itcl trace.


LV In Dec, 2008, on comp.lang.tcl, it was announced that TIP #50 [L1 ] had finally been realized, with itcl 4.0 being merged into the Tcl 8.6 source tree.

apw 20081220 for a feature list of itcl 4.0 (called also itcl-ng) see: [L2 ]. There are a lot of new features like delegation, components, types, widgetadaptors, widgets etc.

FPX 20080306: Yes. [incr Tcl] is very stable and robust, and it is still actively maintained to work with the latest versions of Tcl. Its Web presence may not always be up to date, but the code base in CVS is.

FPX 20080306: [incr Tcl] 3.4 is required with Tcl 8.5 and later.

more about history here, if you please.

Caveats to this page

This page deliberately simplifies the status of itcl and how it won over the other object systems.

See also