oo::objdefine , a built-in Tcl command defines and changes the definition of existing instance objects in TclOO.


oo::objdefine object definitionScript
oo::objdefine object arg arg ?arg ...?

If given as a sequence of args, the definitionScript is created by making a list of those arguments and evaluating that as if it was given as a definitionScript. Supported definitions for use in the definitionScript are:

class className
deletemethod name ?name ...?
export name ?name ...?
filter ?methodName ...?
forward name cmdName ?arg ...?
method name argList bodyScript
mixin ?className ...?
renamemethod fromName toName
unexport name ?name ...?
variable ?name ...?


official reference


my can be used as the command name:

oo::objdefine myobject forward method2 my method1