Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_Obj needs to have invalid transformations

Open219162ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 23 years ago
Descriptionplain2000-10-26 05:02:40
OriginalBugID: 1504 RFE
Version: 8.0.5
SubmitDate: '1999-03-15'
LastModified: '1999-11-01'
Severity: LOW
Status: Assigned
Submitter: pat
ChangedBy: hobbs
OS: All
FixedDate: '2000-10-25'
FixedInVersion: NA
ClosedDate: '2000-10-25'


Tcl 8.x enhancement: Tcl_Obj needs to have invalid transformations.
Some objects can exist only in their internal representation and a
string representation.  All attempts to convert this object to a list,
int, or any other type should fail.  We have tried some workarounds
for this, recommended by Dr. Ousterhout (such as constructing the
string representation as an invalid list).  Unfortunately, since some
of our commands which operate on these objects accept lists of the
objects, then those commands fail to operate as well as lsort,
foreach, etc. which we want to fail.

This is something that should be addressed with Feather. 
-- 11/01/1999 hobbs
dkfplain2000-11-08 18:22:53
When doing this sort of thing in my own code, I've always allowed conversion *to* strings, typically by just printing the pointer out using the %p substitution in sprintf(), and just blocked conversion from strings (which is trivially done by making the appropriate function in the ObjType return an error for all non-blessed inputs.)
Note that it is easier to preserve object representations from 8.3 onwards since Tcl_EvalObj is not quite so aggressively string-oriented (build your command as a list using the ListObj funcs and the internal reps should make it through unscathed.)
dkf Ticket [219162ffff]: 1 change [History diff]2001-01-09 22:12:28
andreas_kupriesplain2001-09-08 06:09:40
Logged In: YES 
user_id=75003

This a feature request, not a bug.
andreas_kupries Ticket [219162ffff]: 1 change [History diff]2001-09-08 06:10:21
dgp Ticket [219162ffff]: 1 change [History diff]2003-11-13 06:14:16
Log in (anonymous is fine) to add a comment.