Overview
| Artifact ID: | 839f620292eb393a4293b011cbb66adc823145b5 |
|---|---|
| Ticket: | 738900ffffffffffffffffffffffffffffffffff
limit shimmer of singleton lists |
| User & Date: | ferrieux on 2016-08-19 17:12:23 |
Changes
- icomment:
To verify, you can simply parse [::tcl::unsupported::representation]'s output on typical shimmering paths. Sure, that's exactly what we try to discourage, but who reads the test suite ? ;-) Now looking at the current implementation, there's still a problem with canonicity, and I believe that may be the reason for the ill-understood breakage mentioned earlier: beware of any existing string rep for the incoming number ! Demo script: set x " 1.3 ";expr {log($x)};llength $x;puts A[lindex $x 0][lindex $x 0]B Output with trunk: A1.31.3B Output with patch: A 1.3 1.3 B As you can see, the problem is that you keep the intrep (possibly noncanonical, e.g. with extra space) of the incoming number both for the "boxed" number and the list: % tcl::unsupported::representation $x value is a list with a refcount of 6, object pointer at 0x1c325d0, internal representation 0x1c411d0:(nil), string representation " 1.3 " % tcl::unsupported::representation [lindex $x 0] value is a double with a refcount of 2, object pointer at 0x1c366e0, internal representation 0x3ff4cccccccccccd:(nil), string representation " 1.3 " While I think only the list (the toplevel object that we are delicately shimmering) should keep that intrep (and be sure to set isCanonical to FALSE), and the boxed number should have no string rep. - login: "ferrieux"
- mimetype: "text/plain"