Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b8f173b5fdf0e2a8b7ce9b0f2e20e52a0e1292a4
Ticket: 489537ffffffffffffffffffffffffffffffffff
string rep of list: should quote '#'
User & Date: dgp on 2001-12-05 20:56:52
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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 changed to: "obsolete: 8.4a4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "10. Objects"
  10. title changed to: "string rep of list: should quote '#'"
  11. type changed to: "Support"