summaryrefslogtreecommitdiffstats
path: root/doc/copy.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-03-27 08:21:12 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-03-27 08:21:12 (GMT)
commit4d9e1c8453091e516efd3919546e5c88e768b53a (patch)
tree042154a9e8b9a31882c87cd9d2c13a7368683e34 /doc/copy.n
parent543416450d89c9fdc7df13eea26715813d861a91 (diff)
downloadtcl-4d9e1c8453091e516efd3919546e5c88e768b53a.zip
tcl-4d9e1c8453091e516efd3919546e5c88e768b53a.tar.gz
tcl-4d9e1c8453091e516efd3919546e5c88e768b53a.tar.bz2
Implementation of TIP #397
Diffstat (limited to 'doc/copy.n')
-rw-r--r--doc/copy.n21
1 files changed, 17 insertions, 4 deletions
diff --git a/doc/copy.n b/doc/copy.n
index 51ec844..f5002f8 100644
--- a/doc/copy.n
+++ b/doc/copy.n
@@ -26,10 +26,23 @@ resolved relative to the current namespace if not an absolute qualified name.
If \fItargetObject\fR is omitted, a new name is chosen. The copied object will
be of the same class as the source object, and will have all its per-object
methods copied. If it is a class, it will also have all the class methods in
-the class copied, but it will not have any of its instances copied. The
-contents of the source object's private namespace \fIwill not\fR be copied; it
-is up to the caller to do this. The result of this command will be the
-fully-qualified name of the new object or class.
+the class copied, but it will not have any of its instances copied.
+.PP
+.VS
+After the \fItargetObject\fR has been created and all definitions of its
+configuration (e.g., methods, filters, mixins) copied, the \fB<cloned>\fR
+method of \fItargetObject\fR will be invoked, to allow for customization of
+the created object such as installing related variable traces. The only
+argument given will be \fIsourceObject\fR. The default implementation of this
+method (in \fBoo::object\fR) just copies the procedures and variables in the
+namespace of \fIsourceObject\fR to the namespace of \fItargetObject\fR. If
+this method call does not return a result that is successful (i.e., an error
+or other kind of exception) then the \fItargetObject\fR will be deleted and an
+error returned.
+.VE
+.PP
+The result of the \fBoo::copy\fR command will be the fully-qualified name of
+the new object or class.
.SH EXAMPLES
.PP
This example creates an object, copies it, modifies the source object, and