Overview
| Artifact ID: | db3a0b512cb18b2cdd1ce87b59ade9ddd81f9d4d |
|---|---|
| Ticket: | 3304643fffffffffffffffffffffffffffffffff
User object info lost on more aggressive numeric conversion |
| User & Date: | sehmann on 2011-05-19 15:04:21 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
Tcl8.4 would convert an object to a numeric type during execution of an operator (such as ==) when the other argument was of a numeric type. It did not attempt to do this conversion if the other argument was "", a string, a user object type. Tcl8.5 now converts both arguments blindly when certain operators (such as ==) are executed. This sometimes results in our objects (our own types) being converted and our internalRep being freed. This causes a large portion of our TCL codebase to have a regression when one of our objects happens to have a string rep that is convertible to a int (eg. "123") or to a double (eg. "INF", "NAN", "0.5"). For example comparing "INF" == "" should not attempt convert both to numeric values. The fundamental problem is that there is no way to retain our object type information or avoid these conversions. We key off the type to cast the internalRep pointer to our internal C++ object. If this is not the best way to do cast to our internal object, please let us know the robustly supported way of doing that. Some solutions we see are: 1) don't do the aggressive conversion (ie. go back to tcl8.4 style) 2) only attempt numeric conversion if the type is one of the standard internal TCL types and not some user-specified type 3) add a boolean to the TCL_Object which controls the immutability of an object (ie. don't do conversion if the flag is set) 4) add a userdata field where we can store what we need (NULL or failure to recognize type stored in there means not our object) We need to be able to move forward with tcl8.5 and eventually tcl8.6 but this is holding us back.
- foundin changed to: "obsolete: 8.5.9"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "sehmann"
- subsystem changed to: "10. Objects"
- title changed to:
User object info lost on more aggressive numeric conversion
- type changed to: "Bug"