Main Content

Object Oriented Tcl

Archive - Originally posted on "The Horse's Mouth" - 2008-02-02 08:45:17 - Graham Ellis

Object Oriented Tcl ([incr-Tcl]) is darned good - but it's only a requirement in a small proportion of the Tcl Training Courses that I give. So it was with real pleasure that I spent some time yesterday writing an example in front of my class in the Nottingham area to show them just how fabulous it is!

The source code of the example I came up with is here, and I have added a whole lot of comments in to it this morning so that readers can see a "hello world" type example of how Tcl implements classes, objects, inheritance, encapsulation, security matters, polymorphism and the rest. And for readers who would like a deeper explanation, you'll find ongoing links ... or I would love to see you on a course!

P.S. Yes - we can train you whether or not you have prior OO experience; our training resources include modules that overview straightforward objects, talk about how objects can be build from other objects and introduce you to OO design principles so you can start making the very best of the facilities

Here's what you get when you run the code I've linked to above.

Dorothy:stuffing grahamellis$ tclsh exv
East Midlands !!!!! place1 - 960 40
First Great Western !!!!! place2 - 1250 25
Connex !!!!! place3 - 0
FGW !!!!! place4 - 5264 94
Dorothy:stuffing grahamellis$