Skip to content
Tcl Source Code History Of Ticket d22ad20205509329
Login

History Of Ticket d22ad20205509329

Artifacts Associated With Ticket d22ad20205509329

  1. Ticket change [87f9039ad3] (rid 164382) by oehhar on 2018-07-02 10:24:28:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      If a dictionary key is unset, there is no error, if it does not exist:
      
      <verbatim>
      % set d {}
      % dict unset d a
      </verbatim>
      
      <hr />
      
      There is an error raised, if a key on the path of the subkey does not exist:
      
      <verbatim>
      % set d {}
      % dict unset d a b
      key "a" not known in dictionary
      </verbatim>
      
      IMHO this is inconsistent and should not rise an error.
      
      At least the documentation should write about error behaviour.
      
      <hr />
      
      I can understand, that an error is raised, if the (sub)dict is not a valid dict.
      
      <verbatim>
      % set d {1}
      % dict unset d a
      missing value to go with key
      % set d {a 1}
      % dict unset d a b
      missing value to go with key
      </verbatim>
      
    5. foundin initialized to: "8.6.8"
    6. is_private initialized to: "0"
    7. login: "oehhar"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "oehhar"
    14. subsystem initialized to: "15. Dict Object"
    15. title initialized to:
      "dict unset d key subkey" fails if key does not exist
      
    16. type initialized to: "Bug"
  2. Ticket change [823f434d5a] (rid 164383) by sebres on 2018-07-02 11:03:13:

    1. icomment:
      Still worse (as regards the inconsistency), it does not produce any error if dictionary self (variable) does not exists:
      
      <code><verbatim>
      % unset -nocomplain d
      % catch { dict unset d a }
      0
      </verbatim></code>
      
      So I'm agree with Harald's conclusion, the `dict unset` must not produce an error if sub-key does not exists also.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [110ef0dbb8] (rid 164384) by sebres on 2018-07-02 11:04:59:

    1. foundin changed to: ">= 8.5"
    2. login: "sebres"
    3. mimetype: "text/plain"
  4. Ticket change [393f75ecb9] (rid 188605) by oehhar on 2020-11-16 14:19:30:

    1. icomment:
      Tested again with tcl8.6.10. Is fixed. Thank you, Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  5. Ticket change [69d5a81801] (rid 188606) by oehhar on 2020-11-16 14:19:43:

    1. closedate changed to: "2459170.09702749"
    2. closer changed to: "oehhar"
    3. login: "oehhar"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"