Skip to content
Tcl Source Code History Of Ticket 3599906fffffffff
Login

History Of Ticket 3599906fffffffff

Artifacts Associated With Ticket 3599906fffffffff

  1. Ticket change [25a7dc9f24] (rid 88207) by heinrichmartin on 2013-01-08 08:52:22:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      "dict keys" takes a dictionaryVALUE, but affects the variable's interpretation by foreach:
      
      expect:/tmp$ set tcl_version 
      8.5
      expect:/tmp$ set x {1 a 2 b 3 c 3 d 3 e} ;# store a list which also is a dictionary value
      1 a 2 b 3 c 3 d 3 e
      expect:/tmp$ foreach {key val} $x {puts "$key -> $val"} ;# print pairs of list elements correctly
      1 -> a
      2 -> b
      3 -> c
      3 -> d
      3 -> e
      expect:/tmp$ dict keys $x ;# the argument is passed by value, isn't it? (see dict or the dodekalogue)
      1 2 3
      expect:/tmp$ foreach {key val} $x {puts "$key -> $val"} ;# we had that very command, and x was not altered.
      1 -> a
      2 -> b
      3 -> e
      expect:/tmp$ set x ;# indeed, x was not altered
      1 a 2 b 3 c 3 d 3 e
      
      Obviously, variables are stored in best-guess-data-structures (lists, dictionaries, ...) whenever a corresponding command is used.
      This performance benefit must not affect consistency.
      
      Why does foreach treat dict-variables differently?
      This should not happen, we do have "dict for"!
      
    4. foundin initialized to: "obsolete: 8.5.13"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "heinrichmartin"
    10. subsystem initialized to: "15. Dict Object"
    11. title initialized to: "dict command has side effects on foreach"
    12. type initialized to: "Bug"
  2. Ticket change [0f11837d41] (rid 94728) by dkf on 2013-01-08 18:09:29:

    1. closedate changed to: "2013-01-08T11:09:29"
    2. closer changed to: "dkf"
    3. icomment:
      This looks like a dupe of 3004007 and that was fixed a few years ago (in time for 8.5.9). What does [info patchlevel] report for a buggy run? I can't duplicate using your exact code with the tip of the 8.5 branch...
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Duplicate"
    7. status changed to: "Pending"
    8. username: "dkf"
  3. Ticket change [28ada1b3ab] (rid 88738) by heinrichmartin on 2013-01-08 20:36:11:

    1. foundin changed to: "obsolete: 8.5.8"
    2. icomment:
      My bad, I did not consider the bugfix version. We are running Debian Squeeze stable and it looks like it's finally time for backports.
      I leave it to you to close the ticket. Thanks for the help, I did not find the duplicate as it does not contain "foreach". Sorry!
      
      
    3. login: "heinrichmartin"
    4. mimetype: "text/plain"
    5. status changed to: "Open"
    6. username: "heinrichmartin"
  4. Ticket change [97694a0276] (rid 106491) by dkf on 2013-01-08 20:46:49:

    1. icomment:
      This artifact has been marked as a duplicate of artifact 3004007 with reason:
      older version under test than expected
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [34497077e9] (rid 106735) by dkf on 2013-01-08 20:46:50:

    1. status changed to: "Closed"