Artifacts Associated With Ticket 489537ffffffffff
Ticket change [b8f173b5fd] (rid 129047) by dgp on 2001-12-05 20:56:52:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Kudos to Joe English for catching this one, and Donal Fellows for analyzing the right solution. list(n) says: list ?arg arg ...? Braces and backslashes get added as necessary,... so that eval may be used to execute the resulting list, with arg1 comprising the command's name and the other args comprising its arguments. However, in an interacive tclsh: % proc # {} {puts !} % set cmd [list #] # % eval $cmd % A patch is attached that offers one fix with changes to Tcl_{Scan|Convert}CountedElement. It is overkill in that it quotes leading '#' in all list elements when it is only needed for the first list element, but in those routines, the ordinal of the element is not known. Perhaps an additional flag value could be added if more sophistication is wanted, limiting the quoting to the first element. Two part.test tests were updated, and tests based on the demo above was added to util.test. - foundin initialized to: "obsolete: 8.4a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "10. Objects"
- title initialized to: "string rep of list: should quote '#'"
- type initialized to: "Support"
Add attachment "liststring.patch" [6648fcc88c] (rid 102683) by dgp on 2001-12-06 03:56:53.
Ticket change [1129b5a24a] (rid 95094) by dgp on 2001-12-06 03:56:54:
- icomment:
File Added - 14214: liststring.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [52f7e41bb6] (rid 126405) by hobbs on 2001-12-06 04:10:51:
- icomment:
Logged In: YES user_id=72656 This is not correct for most cases, where the # is really meant to be a quote and has no command associated with it. This is only valid for the rare cases where the initial #- starting element has a command of the same name.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "1 Zero"
- username: "hobbs"
- icomment:
Ticket change [24020b446d] (rid 131035) by dgp on 2001-12-06 04:13:04:
- icomment:
Logged In: YES user_id=80530 Example?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [6c0af22e1b] (rid 128432) by hobbs on 2001-12-06 05:07:59:
- icomment:
Logged In: YES user_id=72656 The patch changes semantics to the following: [list #foo a b c] == {\#foo a b c} by placing the \ in front of the #. This means that #foo will now be seen as a command, but when it is not (in most cases # will be for comments), then you will throw an error, no? - login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [d74ce2fdb8] (rid 123957) by dgp on 2001-12-06 05:21:22:
- icomment:
Logged In: YES user_id=80530 With the patch: % list #foo a b c {#foo} a b c Does that answer the question? No error thrown, but yes the string rep changes. That's the point. Each list has multiple valid string reps. The guarantees of list(n) are met by the string rep after the patch, but not before. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [1132c33cd7] (rid 95102) by dkf on 2001-12-06 17:00:37:
- icomment:
Logged In: YES user_id=79902 This is a *vevry* long-standing bug, since it was there in Tcl 7.4 (which is the oldest version I've got hanging about here) and it definitely should be resolved the way described as the alternative is to put a special case into the list(n) manpage. Which would be deeply blecherous.
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "4"
- username: "dkf"
- icomment:
Ticket change [40d02c1f9a] (rid 116076) by dgp on 2001-12-08 00:05:26:
- icomment:
Logged In: YES user_id=80530 If the current patch is accepted, many tests in the Tk test suite will fail. The first example is test button-7.2. It expects the result to be: .b1 #543210 {} {} but after the patch the result will actually be: .b1 {#543210} {} {} Possible remedies: 1) Just update all the relevant tests to expect the new string rep. (Create expected value with [list]) 2) Make a more sohpisticated patch that will only quote leading '#' in the first element of a list. 3) Make these tests compare their results as lists, rather than as strings, adding a new type of comparison to tcltest if necessary. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [bea46052db] (rid 102108) by msofer on 2002-03-01 00:50:44:
- icomment:
File Added - 18577: liststring2.patch Logged In: YES user_id=148712 A second patch: this will only quote '#' if it is the first element of the list: A new flag TCL_QUOTE_HASH is added to the interface of Tcl_Convert(Counted)Element.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [cd8aa5addc] (rid 95909) by dgp on 2002-03-01 02:28:53:
- icomment:
Logged In: YES user_id=80530 The new patch works and passes both Tcl and Tk test suites. Haven't gone looking for ways to break it yet.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d582134cb4] (rid 123637) by msofer on 2002-03-01 02:42:17:
- icomment:
File Deleted - 18577: File Added - 18583: liststring2.patch Logged In: YES user_id=148712 Adding a comment to the patch (thanks don!)
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Add attachment "liststring2.patch" [2c20a6a6ab] (rid 118846) by msofer on 2002-03-01 02:46:40.
Ticket change [6b17cdaba4] (rid 128257) by msofer on 2002-03-01 02:46:40:
- icomment:
File Deleted - 18583: File Added - 18584: liststring2.patch
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [07613ef230] (rid 89386) by hobbs on 2002-03-01 02:52:44:
- icomment:
Logged In: YES user_id=72656 I would like to make sure that this is logically worked over before commiting. It may be that the tests that would break don't exist, as it seems like a subtle change that might have ramifications.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [33fa5792cb] (rid 106686) by dgp on 2003-03-05 13:41:57:
- assignee changed to: "dkf"
- icomment:
Logged In: YES user_id=80530 opinion on making this fix in 8.5a0 ?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [74e3c0e949] (rid 105294) by hobbs on 2003-03-06 00:40:46:
- icomment:
Logged In: YES user_id=72656 I think it requires a TIP.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [8274f96be5] (rid 117240) by dgp on 2003-07-23 00:00:33:
- icomment:
Logged In: YES user_id=80530 Because [eval] has pure-list optimizations, this bug now appears as a shimmering inconsistency. Consider this demo script # FILE: demo.tcl set cmdName [lindex $argv 0] proc $cmdName {} {puts Success!} set command [list $cmdName] puts "Eval \[$command]" ;# comment this out eval $command Correct behavior is for the script to write Success! to stdout. As written above, this fails for an argument that begins with the # character. However, if you comment out the indicated [puts], then we avoid string-rep generation, and the script works correctly for all arguments. Seems we should be able to correct a shimmering inconsistency without a TIP. Anyone relying on the buggy behavior should have been caught by the pure-list optimizations in eval by now. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [4a32460d6a] (rid 126498) by dgp on 2003-07-23 04:24:02:
- icomment:
File Added - 56550: 489537.patch Logged In: YES user_id=80530 New patch 489537.patch is same as liststring2.patch except it adds two more tests to util.test that force string rep generation to illustrate the shimmering problem.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [7b7e155a71] (rid 96916) by dgp on 2003-07-24 07:35:34:
- icomment:
Logged In: YES user_id=80530 Here's a completely new patch (replaces previous 489537.patch) that I think is better than all. 1) Does not change the public API (no TIP needed!) 2) Does not disturb the Tk test suite. 3) By default, chooses safe quoting. 4) Leaves open door for a TIP exposing to extensions the power to ask for less quoting of hashes when it is known safe. 5) Corrects several more callers of Tcl_Convert*Element() 6) Adds many more tests for bugs when those callers are not patched. Please review. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d199a2b705] (rid 113382) by dgp on 2003-07-24 07:35:35:
- icomment:
File Deleted - 56550: File Added - 56681: 489537.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [5412573021] (rid 93875) by dkf on 2003-07-24 21:12:33:
- icomment:
Logged In: YES user_id=79902 I'd feel happier if the addition of TCL_DONT_QUOTE_HASH didn't rearrange the positions of the internal Tcl_ConvertElement flags. No reason why that value has to occupy a contiguous bit with TCL_DONT_USE_BRACES... Apart from that, there ought to be an extra dict test like this (or maybe with the result the other way round): test dict-2.8 {dict create command - #-quoting in string rep} { dict create # #comment ## ##comment } {{#} #comment ## ##comment} Minor issues aside, looks excellent to me. - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [cb6c880974] (rid 95516) by dgp on 2003-07-24 22:59:59:
- icomment:
Logged In: YES user_id=80530 updated to address those comments. Now in the form of two patches, one that adds tests to the test suite that demo the bug. And a second that contains the fix. Here's the fix patch...
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [ab620d40c4] (rid 101097) by dgp on 2003-07-24 23:00:00:
- icomment:
File Deleted - 56681: File Added - 56746: 489537-fix.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "489537-test.patch" [e536faa215] (rid 88091) by dgp on 2003-07-24 23:01:26.
Ticket change [06275dc053] (rid 89171) by dgp on 2003-07-24 23:01:26:
- icomment:
Logged In: YES user_id=80530 ...and here's the test patch, that I am committing to HEAD.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [b0f6569940] (rid 98066) by dgp on 2003-07-24 23:01:27:
- icomment:
File Added - 56747: 489537-test.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "489537-fix.patch" [6454867853] (rid 92744) by dgp on 2003-08-09 02:57:59.
Ticket change [946b484c52] (rid 105980) by dgp on 2003-08-09 02:57:59:
- icomment:
File Added - 58219: 489537-fix.patch Logged In: YES user_id=80530 Updated fix patch that implements draft TIP.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [6cad733931] (rid 128558) by dgp on 2003-08-09 02:58:00:
- icomment:
File Deleted - 56746:
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [270c4277b2] (rid 88445) by dgp on 2003-08-10 05:44:18:
- icomment:
Logged In: YES user_id=80530 The attached file 489537-fix.patch is the prototype implementation of TIP 148.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [4ec383d332] (rid 125700) by dgp on 2003-09-04 23:43:41:
- assignee changed to: "davygrvy"
- closedate changed to: "2003-09-04T16:43:41"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 TIP 148 Accepted. Patch committed to HEAD (8.5a0).
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: ""
- status changed to: "Closed"
- username: "dgp"
Ticket change [0d1821ab2d] (rid 114299) by dgp on 2003-09-04 23:46:20:
- assignee changed to: "dgp"
Ticket change [195872184b] (rid 122793) by dkf on 2008-11-21 21:26:58:
- assignee changed to: "nobody"
- foundin changed to: "None"
- icomment:
data_type - 210894
- is_private changed to: "1"
- login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "None"
- username: "dkf"
Ticket change [db5a5598b2] (rid 107944) by dkf on 2009-07-29 19:51:30:
- icomment:
IP - Comment Removed: 130.88.1.31
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment: