''[APW] 2007-06-06'' Some time ago I started efforts to reimplement [Itcl] on top of [tclOO] [http://tip.tcl.tk/257]. After some detours I came back on the tclOO path, thinking that is the best starting point. I started implementing [extension]s to tclOO to get a lot of features of Itcl to run. Doing that I learned a lot more details and "specialities" about Itcl. Having now a better feeling about what is needed for Itcl I will start to write down the missing features and my solution for it in the hope that there will be some comments (especially from [dkf]). These could also include suggestions on how to solve the problem in a different way, without having to modify tclOO. In the following solution means that is my current (not always optimal) solution for the problem Here starts the list, I will add topics if they come up: * [Namespace] names for Itcl problem: Itcl expects that the namespace of a class is the same as the class name solution: add an option -withnamespace or a method createwithnamespace * calling of [method]s without my infront of the method name problem: Itcl resolves command calls first within the class hierarchy before using the normal Tcl rules solution: add a namespace unknown command as a dispatcher for Itcl methods * access to [class] [variable]s problem: Itcl has 3 protection levels which guard the access to class variables in the class hierachy. solution: I use the apply command for constructing the body parts for the class methods (and constructors and destructors) after the complete class has been parsed and all classes in the hiearchy are known. There is an additional parameter self added automaticly to the arguments of the method and the variables of all the classes in the hiearchy are mapped using namespace upvar. Variables in Itcl have to live in the namespace where they are defined as there might be the same variable name in different classes in the hiearchy even with different protection (private, protected public). In generating the namespace upvar commands the private variables of inherited classes are skipped. * Itcl rules for calling/traversing the constructors and destructors problem: the rules for traversing the constructors/destructors in Itcl are very "special" and cannot be mapped to the model in tclOO (to be done: add an example both for tclOo and Itcl here) solution: new command invokeitclconstructors similar to [next] command in tclOO (to be done: add details here) * Itcl special init code script in constructors problem: in Itcl constructors it is possible to define an init script, which is invoked directly before the code in the constructor, but after the object is instantiated solution: add that in building the apply code for the constructors * Itcl special command itcl::body problem: In Itcl it is possible to define a method only partial: protection + name, protection + name + params, protection + name + params + body. That method can be redefined later on, but the params list for the method - if defined in the class definition - has to be compatibleThat method can be redefined later on, but the params list for the method - if defined in the class definition - has to be compatible solution: add addtional information about method params an status to each method definition in the tclOO internal structures. Here is also the problem that tclOO cannot handle partially defined methods, which the solution is adding asfunctionality. * Itcl info command problem: one of the problems: getting the original body of a method when using apply internally solution: save the original body in the tclOO internal structures of a method. In general I am generating a method info (within each class and as a proc in Itcl syntax it is something like a singleton method and it can be called without an object being instantiated) which is first trying the Itcl specific commands, and if that does not work it forwards to the ::info command ---- [[ [Category Object Orientation] | [Category discussion] | [Category Itcl] ]]