Updated 2014-06-09 12:05:41 by RLE

my, a built-in Tcl command, allows one method of an object to invoke another method of the same object.

Documentation  edit

official reference

Description  edit

my invokes any method, including non-exported methods, defined by current object, i.e., the object that the method which calls my is bound to.

my is actually a separate command that is created in each object's namespace, so it can be invoked from outside the object if you know the name of the namespace or if you use namespace code inside the object to wrap the invocation. This is useful for callbacks like variable traces or bind event handlers, and also for oo::objdefine foward and oo::define forward.