Compare commits

...
Author SHA1 Message Date
bch 4291aaaed6 additional notes re: Tcl_ConvertToType() 2022-09-25 07:32:32 +00:00
bch 40227f3efa Type management, per conversation w/ dgp 2022-09-25 07:20:50 +00:00
2 changed files with 4 additions and 7 deletions
+2 -5
View File
@@ -220,10 +220,7 @@ the value.
The same value holding the same string value
can have several different internal representations
at different times.
Extension writers can also force a value to be converted from one type
to another using the \fBTcl_ConvertToType\fR procedure.
Only programmers that create new value types need to be concerned
about how this is done.
[...]
A procedure defined as part of the value type's implementation
creates a new internal representation for a value
and changes its \fItypePtr\fR.
@@ -351,7 +348,7 @@ incrementing the integer in its internal representation.
If it is shared, it needs to duplicate the value
in order to avoid accidentally changing values in other data structures.
.SH "SEE ALSO"
Tcl_ConvertToType(3), Tcl_GetIntFromObj(3), Tcl_ListObjAppendElement(3), Tcl_ListObjIndex(3), Tcl_ListObjReplace(3), Tcl_RegisterObjType(3)
Tcl_GetIntFromObj(3), Tcl_ListObjAppendElement(3), Tcl_ListObjIndex(3), Tcl_ListObjReplace(3), Tcl_RegisterObjType(3)
.SH KEYWORDS
internal representation, value, value creation, value type,
reference counting, string representation, type conversion
+2 -2
View File
@@ -72,8 +72,8 @@ The return value is \fBTCL_OK\fR unless there was an error
converting \fIobjPtr\fR to a list value;
in that case \fBTCL_ERROR\fR is returned.
.PP
\fBTcl_ConvertToType\fR converts a value from one type to another
if possible.
\fBTcl_ConvertToType\fR use is contraindicated. It was originally
designed to convert a value from one type to another if possible.
It creates a new internal representation for \fIobjPtr\fR
appropriate for the target type \fItypePtr\fR
and sets its \fItypePtr\fR member as determined by calling the