diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-04-11 11:18:51 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-04-11 11:18:51 (GMT) |
commit | 82bda7f2081c47a741b7e6217cf061137fd35219 (patch) | |
tree | 7384ba8f128f12704a52e5fc85f4c8074f6fb83e /doc/define.n | |
parent | e77f7f0935b2ac4f3f02ec972fc4d14366f880c3 (diff) | |
download | tcl-82bda7f2081c47a741b7e6217cf061137fd35219.zip tcl-82bda7f2081c47a741b7e6217cf061137fd35219.tar.gz tcl-82bda7f2081c47a741b7e6217cf061137fd35219.tar.bz2 |
Clarify the rules for resolution of what forwarded methods forward to.
Diffstat (limited to 'doc/define.n')
-rw-r--r-- | doc/define.n | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/doc/define.n b/doc/define.n index ddbf476..e3f2e39 100644 --- a/doc/define.n +++ b/doc/define.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: define.n,v 1.2 2008/09/23 05:05:47 dkf Exp $ +'\" RCS: @(#) $Id: define.n,v 1.3 2009/04/11 11:18:51 dkf Exp $ '\" .so man.macros .TH define n 0.3 TclOO "TclOO Commands" @@ -94,23 +94,27 @@ arguments are present, the list of filter names is set to empty. .TP \fBforward\fI name cmdName \fR?\fIarg ...\fR? . -This creates or updates a forwarded method called \fIname\fR. The method -is defined be forwarded to the command called \fIcmdName\fR, with additional +This creates or updates a forwarded method called \fIname\fR. The method is +defined be forwarded to the command called \fIcmdName\fR, with additional arguments, \fIarg\fR etc., added before those arguments specified by the -caller of the method. Forwarded methods should be deleted using the -\fBmethod\fR subcommand. The method will be exported if \fIname\fR starts with -a lower-case letter, and non-exported otherwise. +caller of the method. The \fIcmdName\fR will always be resolved using the +rules of the invoking objects' namespaces, i.e., when \fIcmdName\fR is not +fully-qualified, the command will be searched for in each object's namespace, +using the instances' namespace's path, or by looking in the global namespace. +The method will be exported if \fIname\fR starts with a lower-case letter, and +non-exported otherwise. .TP \fBmethod\fI name argList bodyScript\fR . -This creates, updates or deletes a method. The name of the method is -\fIname\fR, the formal arguments to the method (defined using the same format -as for the Tcl \fBproc\fR command) will be \fIargList\fR, and the body of the -method will be \fIbodyScript\fR. When the body of the method is evaluated, the -current namespace of the method will be a namespace that is unique to the -current object. The method will be exported if \fIname\fR starts with a -lower-case letter, and non-exported otherwise; this behavior can be overridden -via \fBexport\fR and \fBunexport\fR. +This creates or updates a method that is implemented as a procedure-like +script. The name of the method is \fIname\fR, the formal arguments to the +method (defined using the same format as for the Tcl \fBproc\fR command) will +be \fIargList\fR, and the body of the method will be \fIbodyScript\fR. When +the body of the method is evaluated, the current namespace of the method will +be a namespace that is unique to the current object. The method will be +exported if \fIname\fR starts with a lower-case letter, and non-exported +otherwise; this behavior can be overridden via \fBexport\fR and +\fBunexport\fR. .TP \fBmixin\fR ?\fIclassName ...\fR? . |