<h1>my</h1>
<H3><A
<b>my</b> &mdash; invoke any method of current object
<H3><A
package require TclOO<BR>
<BR>
<B>my</B><I> methodName</I> ?<I>arg ...</I>?<BR>
<H3><A
The <B>my</B> command is used to allow methods of objects to invoke any method
of the object (or its class). In particular, the set of valid values for
<I>methodName</I> is the set of all methods supported by an object and its
superclasses, including those that are not exported. The object upon which the
method is invoked is always the one that is the current context of the method
(i.e. the object that is returned by <B><A HREF="?name=Doc:+self">self from which the
<B>my</B> command is invoked.
<P>
Each object has its own <B>my</B> command, contained in its instance namespace.
<H3><A
This example shows basic use of <B>my</B> to use the <B>variables</B> method of
the <B><A class, which is not publicly visible by default:
<P>
<PRE>oo::class create c {
    method count {} {
        <B>my</B> variable counter
        puts [incr counter]
    }
}
c create o
o count              <I><font size="+1">&#8594;</font> prints &quot;1&quot;</I>
o count              <I><font size="+1">&#8594;</font> prints &quot;2&quot;</I>
o count              <I><font size="+1">&#8594;</font> prints
<H3><A NAME="M6">SEE
<B><A <B><A <B><A
<H3><A
method, method visibility, object, private method, public method