incr Tcl 3.0 Porting


One of the main aspects of iTcl or [incr Tcl] 3.0 is its backward compatibility with its earlier releases (to the maximum extent possible). If you look at its features carefully you’d notice that this is indeed true. For instance, there’s no change at all in the class definition syntax when compared to [incr Tcl] 2.2. The old syntax is equally well supported in the 3.0 release.

Nevertheless, you’ll come across changes pertaining to the namespaces. A slightly distinct namespace model has been adopted for Tcl 8. There’s a change in the syntax used for the ‘namespace’ command, and the semantics for variable/command imports and lookups are also different. Furthermore, as the ensembles hadn’t been adopted in the Tcl’s core, you won’t find iTcl adding functions like ‘info classes’ and ‘info objects’ into the regular ‘info’ command. Such functions have been displaced to the new command - ‘itcl::find’.

Then there’s quite a bit of change in the [incr Widgets] package. You’ll find several new widgets. Many of the existing widgets had to be streamlined and some widget options even had to be removed for improving performance. You can refer to the ‘CHANGES’ file located inside the ‘iwidgets 3.0.0’ directory for checking the details. As there were plenty of changes, the [incr Tcl] 3.0 distribution also consisted of ‘iwidgets 2.2.0’ package to provide for backward compatibility with the current [incr Widgets].

On the whole, it shouldn’t be very difficult for developers to migrate their Tcl code for smooth working with [incr Tcl] 3.0. In fact the complete [incr Widgets] library can be updated in as less as few hours!