diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-05-31 11:41:59 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-05-31 11:41:59 (GMT) |
commit | 5b6e0993e188fd16bbb2ec7f54b8b0c7be873629 (patch) | |
tree | b68d9c4cbdbd0775c0419a152b70758bde998ca0 /doc/my.n | |
parent | 032cdb06a8056b84ec16eaace0fc84044c95899a (diff) | |
download | tcl-5b6e0993e188fd16bbb2ec7f54b8b0c7be873629.zip tcl-5b6e0993e188fd16bbb2ec7f54b8b0c7be873629.tar.gz tcl-5b6e0993e188fd16bbb2ec7f54b8b0c7be873629.tar.bz2 |
Implementation of TIP #257. Incomplete due to missing Win build support.
Diffstat (limited to 'doc/my.n')
-rw-r--r-- | doc/my.n | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/doc/my.n b/doc/my.n new file mode 100644 index 0000000..75d7bac --- /dev/null +++ b/doc/my.n @@ -0,0 +1,56 @@ +'\" +'\" Copyright (c) 2007 Donal K. Fellows +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: my.n,v 1.1 2008/05/31 11:42:13 dkf Exp $ +'\" +.so man.macros +.TH my n 0.1 TclOO "TclOO Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +my \- invoke any method of current object +.SH SYNOPSIS +.nf +package require TclOO + +\fBmy\fI methodName\fR ?\fIarg ...\fR? +.fi +.BE + +.SH DESCRIPTION +The \fBmy\fR 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 +\fImethodName\fR 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 \fBself object\fR) from which the +\fBmy\fR command is invoked. +.PP +Each object has its own \fBmy\fR command, contained in its unique namespace. +.SH EXAMPLES +This example shows basic use of \fBmy\fR to use the \fBvariables\fR method of +the \fBoo::object\fR class, which is not publically visible by default: +.CS +oo::class create c { + method count {} { + \fBmy\fR variable counter + print [incr counter] + } +} +c create o +o count \fI\(-> prints "1"\fR +o count \fI\(-> prints "2"\fR +o count \fI\(-> prints "3"\fR +.CE +.SH "SEE ALSO" +next(n), oo::object(n), self(n) +.SH KEYWORDS +method, method visibility, object, private method, public method + +.\" Local variables: +.\" mode: nroff +.\" fill-column: 78 +.\" End: |