Is there a possibility in Itcl to extend a class dynamically with methods inside the constructor?
I have some functions which are generated dynamically...
They look somehow like this:
proc attributeFunction fname {
set res "proc $fname args {
#set a attribute list in the class
}"
uplevel 1 $res
}
Now I have a file which has a list of possible attributes:
attributeFunction ::func1
attributeFunction ::func2
attributeFunction ::func3
...
This file gets sourced. But until now I am adding global functions. It would be way nicer to add these functions as methods to an Itcl object.
A little background information:
This is used to generate an abstract language where the user can easily add these attributes by writing them without any other keyword. The use of functions here offers a lot of advantages I do not want to miss.