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

History Of Ticket 1710795fffffffff

Artifacts Associated With Ticket 1710795fffffffff

  1. Ticket change [7d18871970] (rid 97188) by dgp on 2007-05-01 20:28:15:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      The Tcl_DictObj(First|Next|Done) routines
      are offered to manage an iteration through
      the contents of a dictionary.
      
      The documentation says:
      
      "The donePtr argument points to a variable that is
      updated to be zero  of there are further key/value
      pairs to be iterated over, or non-zero if the
      iteration is complete."
      
      I interpret that to mean a result of (*donePtr = 1)
      means the next call to Tcl_DictObjNext would fail
      to return anything, so it need not be made.
      
      That's not what the implementation does.
      
      The implementation has (*donePtr = 1) means that
      the current call did not return anything.
      
      Either scheme is workable, but the docs need
      to be more clear.  Confusion about whether/when
      Tcl_DictObjDone() needs to be called caused
      Tcl Bug 1710709.
      
      
    4. foundin initialized to: "obsolete: 8.5a6"
    5. is_private initialized to: "0"
    6. priority initialized to: "7 High"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dgp"
    10. subsystem initialized to: "15. Dict Object"
    11. title initialized to: "First|Next|Done docs are confusing"
    12. type initialized to: "Bug"
  2. Ticket change [50455d3f75] (rid 125934) by dkf on 2007-05-02 06:05:32:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      Originally, Done was only called when you wanted to break out of iterating early, and this was found to work well enough in the basic implementations in tclDictObj.c. But later on (when I was writing the bytecode compiled versions IIRC) I discovered that this in fact sucked and was too hard to use right, and that it was better instead to arrange for Done to be always callable after the iteration completed. (I believe that the Done call can be avoided in the same circumstances that it always could be avoided, but it's easier to avoid having to explain it by making repeat calls idempotent.)
      
      I do not recall at what point I wrote the documentation. :-)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [dec1ba7b7c] (rid 114904) by dkf on 2007-06-30 05:37:59:

    1. closedate changed to: "2007-06-29T22:37:59"
    2. closer changed to: "dkf"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"