tags:

views:

201

answers:

4

Which object oriented system in TCL is considered the standard?

+1  A: 

There doesn't seem to be a single object system for Tcl which stands out as the standard yet, but XOTcl and Snit are pretty close; the object system being added to the core in version 8.6 is based on them (see here).

Nathan Kitchen
+2  A: 

The object system being included with Tcl is, in effect, an oo framework. While it's possible to work directly with it, it's goal is to be the framework upon which other OO systems can be built on top of. The three object systems which are probably most widely known for Tcl (itcl, xotcl, snit) are all mentioned in the link provided by Nathan.

I've worked with itcl, and it's very easy to use if you're used to C/C++/Java/etc.

I found XOTcl to be a little annoying to work with, but many people love it for it's power so take that with a grain of salt.

Snit is a pure tcl OO system (included in tcllib and, hence, easy to get and included in any batteries included dist)

Short summary: There isn't a standard, per se. If you want something you can use with the best likelihood of being installed no matter where you go, then Snit is likely the best choice.

RHSeeger
+2  A: 

Take a look at the Tcl Wiki for a complete listing of the OO systems for Tcl. It looks like folks voted on incorporating Incr Tcl into the Tcl core, which tells me Incr Tcl was pretty close to being standard. While, the oo system in the core is based on other oo languages, I believe the namespace system was derived from Incr Tcl.

http://www.tcl.tk/cgi-bin/tct/tip/50

Trey Jackson
A: 

Tcl 8.6 comes with TclOO built in (which derives from rather a lot of other OO systems) and a version of [incr Tcl] as a contributed extension package. While I anticipate that people will move eventually to TclOO for most of their needs, Tcl programmers as a group tend to prefer not tinkering too much with working systems and so don't usually adopt new features all that rapidly.

Donal Fellows