Version 3 of The major new features of Tcl/Tk 8.6

Updated 2012-11-06 12:33:09 by oehhar

[This page is being used to work on building more user-oriented descriptions of the new features of 8.6; please have a bit of care as this is work-in-progress right now]

Included Object Systems

Tcl 8.6 includes two object systems (that's two more than any previous release of Tcl). But just because we provide them does not mean that your scripts have to change; objects in Tcl are just commands that have a particular way of accessing subcommands that you should already be familiar with:

someCommandThatIsAnObject theSubcommandThatIsAMethod someArgument1 someArgument2

If you've used Tk, you've used that pattern. If you've used many of Tcl's commands (the ensembles, like string or namespace or chan or interp), you've used that pattern.

TclOO (also available as a stand-alone package for Tcl 8.5) is designed to be a small, efficient and powerful object system core that is deeply connected into Tcl and into the way that Tcl works logically. It currently does not ship with a substantial class library, but it is designed to offer a base on which other object systems can be built.

incr Tcl 4 also ships with Tcl (and it's an example of an object system built on top of TclOO). There's a much larger class library available for itcl.

The Non-Recursive Evaluation Engine

Tcl 8.6 is in many ways a “stackless Tcl”. This has many subtle consequences.

  1. Tcl can now support very deep recursion (though it usually has a limit of 1000 imposed, which you can control with interp recursionlimit).
  2. Tcl can now perform tail-calls, which replace the current procedure call with a call to some other command.
  3. Tcl supports coroutines, a system for allowing you to restructure your programs from continuation-passing style into much more straight-line code (with appropriate yields at the points where you want to stop the coroutine from running while something else is happening).

Database Support

We now define a standard interface (TDBC) for accessing databases, and ship a few database drivers that support the interface. We also include SQLite, the database engine that started as a Tcl extension and then escaped into the big bad world!

New Commands

lmap and try and zlib and …

msgcat::mcflset

Facilates to translate your application using message catalog files by not repeating the locale for each command.