Skip to content
Tcl Source Code History Of Ticket bd45a0e32a1ce6cb
Login

History Of Ticket bd45a0e32a1ce6cb

Artifacts Associated With Ticket bd45a0e32a1ce6cb

  1. Ticket change [60c852d253] (rid 164914) by jal_frezie on 2018-08-13 16:49:37:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      if you lappend a string starting with # to an empty list or new variable, it gets wrapped in braces, but not if you lappend it to an existing list. e.g.,
      % lappend new #1234
      {#1234}
      % lappend new #1234
      {#1234} #1234
      % 
      Expected behaviour is the element should be put in braces only if they are needed to make it a single list element.
      
    5. foundin initialized to: "8.6.6"
    6. is_private initialized to: "0"
    7. login: "jal_frezie"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "21e680c66afc6863cbbaf0aa5b26c9e8a4429339"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "jal_frezie"
    14. subsystem initialized to: "17. Commands I-L"
    15. title initialized to:
      lappend puts some args in braces if they start list
      
    16. type initialized to: "Bug"
  2. Ticket change [09d88a1a64] (rid 164916) by sebres on 2018-08-13 17:12:31:

    1. closedate changed to: "2458344.21702638"
    2. closer changed to: "sebres"
    3. icomment:
      It's not a bug, it's a feature.
      
      This way tcl allows to use canonical list as the command, for example compare:
      <code><pre style="padding-left: 10pt">
      % set l {{#0} #1 #2}
      {#0} #1 #2
      % if 1 $l
      invalid command name "#0"
      
      % set l {#0 #1 #2}
      #0 #1 #2
      % if 1 $l
      </pre></code>
      
      You see in the first case tcl invokes the command "#0"... 
      in second case it ignores the content of list because it is a comment in this case.
      
      In case of the list representation, it working as expected, so each element is the same:
      
      <code><pre style="padding-left: 10pt">
      % set new
      {#1234} #1234
      
      % lindex $new 0
      #1234
      % lindex $new 1
      #1234
      </pre></code>
      
      Thus closed as invalid.
      
    4. login: "sebres"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
  3. Ticket change [81b7b12b89] (rid 164917) by jal_frezie on 2018-08-13 18:36:19:

    1. closedate changed to: "2458344.27522301"
    2. closer changed to: "jal_frezie"
    3. icomment:
      In that case I would expect an element starting with # to be braced wherever it is added in the list, as is the case for elements starting with $. That also would not interfere with the list representation, and would be more consistent.
      
    4. login: "jal_frezie"
    5. mimetype: "text/plain"
  4. Ticket change [9e91b0f00e] (rid 164918) by sebres on 2018-08-13 19:15:18:

    1. closedate changed to: "2458344.30230047"
    2. closer changed to: "sebres"
    3. icomment:
      String representation of list-type is not constructed for "consistent" reasons as you meant it, but primary for example to follow the EIAS magic (see https://wiki.tcl.tk/3018), resp. secondary to avoid the lost of the list representation in case of interim type switch (e. g. list -> unicode, -> dict, etc. and then back to list by usage of lindex for example).
      
      Additionally Tcl follows "the shorter the better" strategy in the canonical form, so basically if possible the shortest will be preferred (even with some exceptions, like for the first argument for already explained reasons).
      The $, some constellations with backslashes, non-balanced quotes and another special characters could cause a string representation that are totally impossible without usage of braces, therefore it will be escaped this way.
      
      If you try to work with the string representation of list using something other as "list" primitives and API functions, you should be ready to experience many other surprises...
      
    4. login: "sebres"
    5. mimetype: "text/plain"