2 '\" Copyright (c) 2007 Donal K. Fellows
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 .TH my n 0.1 TclOO "TclOO Commands"
10 '\" Note: do not modify the .SH NAME line immediately below!
12 my \- invoke any method of current object
17 \fBmy\fI methodName\fR ?\fIarg ...\fR?
22 The \fBmy\fR command is used to allow methods of objects to invoke any method
23 of the object (or its class). In particular, the set of valid values for
24 \fImethodName\fR is the set of all methods supported by an object and its
25 superclasses, including those that are not exported. The object upon which the
26 method is invoked is always the one that is the current context of the method
27 (i.e. the object that is returned by \fBself object\fR) from which the
28 \fBmy\fR command is invoked.
30 Each object has its own \fBmy\fR command, contained in its instance namespace.
33 This example shows basic use of \fBmy\fR to use the \fBvariables\fR method of
34 the \fBoo::object\fR class, which is not publicly visible by default:
39 \fBmy\fR variable counter
44 o count \fI\(-> prints "1"\fR
45 o count \fI\(-> prints "2"\fR
46 o count \fI\(-> prints "3"\fR
49 next(n), oo::object(n), self(n)
51 method, method visibility, object, private method, public method