Version 8 of OO libraries

Updated 2006-02-16 08:35:26

There is lot of discussion on whether to add OO in TCL base or not.

The best way to resolve is start developing libraries like "collector classes" , eg, a generic for-each command for lists,arrays etc and let people start using them. More the libraries and more people using them, then things will find its place naturally.

The OO should not be inconsistent with TCL semantics. The first word is a "command" . Most OO implementations , make the first word "the object".

It should have TCL spirit. The base should have minimal stuff. Impatient people skip the philosophy section to go to the concrete stuff

OO philosophy


Why object orientation -? Thoughts on OO, Natural language, human thinking. To put it simple, TCL is simple language. This language simplicity should not make application complexity. More one interacts with TCL more the "verbs" (commands) one needs to know. This causes cognitive load.

Analogy with natural language, more new products come in, but number of "verbs" does not explode in the language. When you say "open the door" , "open the letter" , "open the computer". "open" is the verb. verb represents an action. More precisely, this action can be thought of as a sequence of actions. More precisely, if sequence of actions are mapped to verbs, then we will have "open_door" , "open_letter", "open_computer" verbs. This is because sequence of actions are different for "open_door", "open_letter".But we don't use it that way. Therefore the "open" verb is a kind of generic "verb" that maps to specific verb "open_door" or "open_letter" based on the the type of object. This mapping happens implicitly in our mind. Natural language evolution was based on the cognitive limits of human mind.

The same way TCL has commands. They are more like "verbs" but "specific verbs". They map to a unique sequence of actions defined in proc. We need TCL to support "generic commands" something like "generic verbs" , we use commonly in natural language.


This is "TCL way of object orientation", I feel.Here is an example.