Learning Tclkit

Tclkit is another piece of technology without which our puzzle can't be completed. Basically, it is a single executable file that contains inside it a normal Tcl interpreter along with a set of extensions, such as:

  • Tk—for graphic interfaces
  • IncrTcl—for object-oriented programming—currently, it is an optional part of TclKit
  • TclVFS—the virtual file system, explained earlier; Tclkit contains drivers only for ZIP and MetaKit
  • Metakit—this was also explained earlier

The beauty and power of Tclkit comes from fact that it does not require installation, and that it is supported on a wide set of platforms, including:

  • AIX
  • FreeBSD
  • various distribution of Linux on architectures including x86, PowerPC, S/390 and others
  • HPUX
  • IRIX
  • MacOS Classic and MacOS X
  • Solaris
  • Windows

Tclkit may be obtained from the http://www.equi4.com/tclkit/index.html website.

At the time of writing this book, the latest version contains Tcl version 8.5.2. In the rest of this section, we will consider examples on the Windows platform. In this case, the Tclkit filename is strictly tclkit-win32.upx.exe (it is compressed internally with the UPX packer). Due to some differences between Windows and other platforms, an additional version with console support (but without Tk) is available as tclkitsh-win32.upx.exe. Running these examples on Unix platforms should require very little or no change, except for specifying different binary names.

Let's revisit the example from the Chapter 1, Introducing Tcl, which prints the "Hello World" message. Running it with Tclkit is as simple as running it with a normal tclsh interpreter:

Learning Tclkit
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.237.194