summaryrefslogtreecommitdiffstats
path: root/doc/Object.3
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-07-04 15:24:45 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-07-04 15:24:45 (GMT)
commitf41a7b9a9464e3211cf4935e2d0d56994cd727c7 (patch)
treeb278be58d13b204b0a6959bc385f6b577ecefd11 /doc/Object.3
parente5f7a7f23ddbcd485a524a6fd1f60c2f6787c794 (diff)
downloadtcl-f41a7b9a9464e3211cf4935e2d0d56994cd727c7.zip
tcl-f41a7b9a9464e3211cf4935e2d0d56994cd727c7.tar.gz
tcl-f41a7b9a9464e3211cf4935e2d0d56994cd727c7.tar.bz2
Remove over-wide lines from nroff output.
Diffstat (limited to 'doc/Object.3')
-rw-r--r--doc/Object.316
1 files changed, 7 insertions, 9 deletions
diff --git a/doc/Object.3 b/doc/Object.3
index 6a0848b..2d3a206 100644
--- a/doc/Object.3
+++ b/doc/Object.3
@@ -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: Object.3,v 1.15 2006/08/03 22:46:34 nijtmans Exp $
+'\" RCS: @(#) $Id: Object.3,v 1.16 2007/07/04 15:24:45 dkf Exp $
'\"
.so man.macros
.TH Tcl_Obj 3 8.5 Tcl "Tcl Library Procedures"
@@ -106,7 +106,6 @@ Seven types are predefined in the Tcl core
including integer, double, list, and bytecode.
Extension writers can extend the set of types
by using the procedure \fBTcl_RegisterObjType\fR .
-
.SH "THE TCL_OBJ STRUCTURE"
.PP
Each Tcl object is represented by a \fBTcl_Obj\fR structure
@@ -230,7 +229,6 @@ creates a new internal representation for an object
and changes its \fItypePtr\fR.
See the man page for \fBTcl_RegisterObjType\fR
to see how to create a new object type.
-
.SH "EXAMPLE OF THE LIFETIME OF AN OBJECT"
.PP
As an example of the lifetime of an object,
@@ -270,7 +268,6 @@ The string representation of \fIx\fR's object is needed
and is recomputed.
The string representation is now \fB124\fR
and both representations are again valid.
-
.SH "STORAGE MANAGEMENT OF OBJECTS"
.PP
Tcl objects are allocated on the heap and are shared as much as possible
@@ -323,21 +320,22 @@ For example, the following code appears in the command procedure
that implements \fBlinsert\fR.
This procedure modifies the list object passed to it in \fIobjv[1]\fR
by inserting \fIobjc-3\fR new elements before \fIindex\fR.
+.PP
.CS
listPtr = objv[1];
if (Tcl_IsShared(listPtr)) {
- listPtr = Tcl_DuplicateObj(listPtr);
+ listPtr = Tcl_DuplicateObj(listPtr);
}
-result = Tcl_ListObjReplace(interp, listPtr, index, 0, (objc-3), &(objv[3]));
+result = Tcl_ListObjReplace(interp, listPtr, index, 0,
+ (objc-3), &(objv[3]));
.CE
+.PP
As another example, \fBincr\fR's command procedure
must check whether the variable's object is shared before
incrementing the integer in its internal representation.
If it is shared, it needs to duplicate the object
in order to avoid accidentally changing values in other data structures.
-
.SH "SEE ALSO"
-Tcl_ConvertToType, Tcl_GetIntFromObj, Tcl_ListObjAppendElement, Tcl_ListObjIndex, Tcl_ListObjReplace, Tcl_RegisterObjType
-
+Tcl_ConvertToType(3), Tcl_GetIntFromObj(3), Tcl_ListObjAppendElement(3), Tcl_ListObjIndex(3), Tcl_ListObjReplace(3), Tcl_RegisterObjType(3)
.SH KEYWORDS
internal representation, object, object creation, object type, reference counting, string representation, type conversion