Skip to content
Tcl Source Code History Of Ticket 489537
Login

History Of Ticket 489537

Artifacts Associated With Ticket 489537

  1. Ticket change [b8f173b5fd] (rid 129047) by dgp on 2001-12-05 20:56:52:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
      
    4. foundin initialized to: "obsolete: 8.4a4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "10. Objects"
    10. title initialized to: "string rep of list: should quote '#'"
    11. type initialized to: "Support"
  2. Add attachment "liststring.patch" [6648fcc88c] (rid 102683) by dgp on 2001-12-06 03:56:53.

  3. Ticket change [1129b5a24a] (rid 95094) by dgp on 2001-12-06 03:56:54:

    1. icomment:
      
      
      File Added - 14214: liststring.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [52f7e41bb6] (rid 126405) by hobbs on 2001-12-06 04:10:51:

    1. 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.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. priority changed to: "1 Zero"
    5. username: "hobbs"
  5. Ticket change [24020b446d] (rid 131035) by dgp on 2001-12-06 04:13:04:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Example?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [6c0af22e1b] (rid 128432) by hobbs on 2001-12-06 05:07:59:

    1. 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?
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  7. Ticket change [d74ce2fdb8] (rid 123957) by dgp on 2001-12-06 05:21:22:

    1. 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.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [1132c33cd7] (rid 95102) by dkf on 2001-12-06 17:00:37:

    1. 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.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. priority changed to: "4"
    5. username: "dkf"
  9. Ticket change [40d02c1f9a] (rid 116076) by dgp on 2001-12-08 00:05:26:

    1. 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.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [bea46052db] (rid 102108) by msofer on 2002-03-01 00:50:44:

    1. 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.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  11. Ticket change [cd8aa5addc] (rid 95909) by dgp on 2002-03-01 02:28:53:

    1. 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.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [d582134cb4] (rid 123637) by msofer on 2002-03-01 02:42:17:

    1. icomment:
      
      
      File Deleted - 18577: 
      
      
      
      File Added - 18583: liststring2.patch
      
      Logged In: YES 
      user_id=148712
      
      Adding a comment to the patch (thanks don!)
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  13. Add attachment "liststring2.patch" [2c20a6a6ab] (rid 118846) by msofer on 2002-03-01 02:46:40.

  14. Ticket change [6b17cdaba4] (rid 128257) by msofer on 2002-03-01 02:46:40:

    1. icomment:
      
      
      File Deleted - 18583: 
      
      
      
      File Added - 18584: liststring2.patch
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  15. Ticket change [07613ef230] (rid 89386) by hobbs on 2002-03-01 02:52:44:

    1. 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.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  16. Ticket change [33fa5792cb] (rid 106686) by dgp on 2003-03-05 13:41:57:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      
      opinion on making this fix in 8.5a0 ?
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  17. Ticket change [74e3c0e949] (rid 105294) by hobbs on 2003-03-06 00:40:46:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      I think it requires a TIP.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  18. Ticket change [8274f96be5] (rid 117240) by dgp on 2003-07-23 00:00:33:

    1. 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.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  19. Ticket change [4a32460d6a] (rid 126498) by dgp on 2003-07-23 04:24:02:

    1. 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.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  20. Ticket change [7b7e155a71] (rid 96916) by dgp on 2003-07-24 07:35:34:

    1. 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.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  21. Ticket change [d199a2b705] (rid 113382) by dgp on 2003-07-24 07:35:35:

    1. icomment:
      
      
      File Deleted - 56550: 
      
      
      
      File Added - 56681: 489537.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  22. Ticket change [5412573021] (rid 93875) by dkf on 2003-07-24 21:12:33:

    1. 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.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  23. Ticket change [cb6c880974] (rid 95516) by dgp on 2003-07-24 22:59:59:

    1. 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...
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  24. Ticket change [ab620d40c4] (rid 101097) by dgp on 2003-07-24 23:00:00:

    1. icomment:
      
      
      File Deleted - 56681: 
      
      
      
      File Added - 56746: 489537-fix.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  25. Add attachment "489537-test.patch" [e536faa215] (rid 88091) by dgp on 2003-07-24 23:01:26.

  26. Ticket change [06275dc053] (rid 89171) by dgp on 2003-07-24 23:01:26:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      ...and here's the test patch,
      that I am committing to HEAD.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  27. Ticket change [b0f6569940] (rid 98066) by dgp on 2003-07-24 23:01:27:

    1. icomment:
      
      
      File Added - 56747: 489537-test.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  28. Add attachment "489537-fix.patch" [6454867853] (rid 92744) by dgp on 2003-08-09 02:57:59.

  29. Ticket change [946b484c52] (rid 105980) by dgp on 2003-08-09 02:57:59:

    1. icomment:
      
      
      File Added - 58219: 489537-fix.patch
      
      Logged In: YES 
      user_id=80530
      
      
      Updated fix patch that implements
      draft TIP.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  30. Ticket change [6cad733931] (rid 128558) by dgp on 2003-08-09 02:58:00:

    1. icomment:
      
      
      File Deleted - 56746: 
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  31. Ticket change [270c4277b2] (rid 88445) by dgp on 2003-08-10 05:44:18:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      The attached file 489537-fix.patch
      is the prototype implementation
      of TIP 148.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  32. Ticket change [4ec383d332] (rid 125700) by dgp on 2003-09-04 23:43:41:

    1. assignee changed to: "davygrvy"
    2. closedate changed to: "2003-09-04T16:43:41"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      
      TIP 148 Accepted.  Patch committed
      to HEAD (8.5a0).
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: ""
    8. status changed to: "Closed"
    9. username: "dgp"
  33. Ticket change [0d1821ab2d] (rid 114299) by dgp on 2003-09-04 23:46:20:

    1. assignee changed to: "dgp"
  34. Ticket change [195872184b] (rid 122793) by dkf on 2008-11-21 21:26:58:

    1. assignee changed to: "nobody"
    2. foundin changed to: "None"
    3. icomment:
      
      
      data_type - 210894
      
      
      
    4. is_private changed to: "1"
    5. login: "dkf"
    6. mimetype: "text/plain"
    7. subsystem changed to: "None"
    8. username: "dkf"
  35. Ticket change [db5a5598b2] (rid 107944) by dkf on 2009-07-29 19:51:30:

    1. icomment:
      
      
      IP - Comment Removed: 130.88.1.31
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"