Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 87f9039ad35a2fbb0e09faaa4fe3cca1b70cd75224213bcaef2b3fd1cdda63f4
Ticket: d22ad202055093292992c6aea053188f8b3d4abe
"dict unset d key subkey" fails if key does not exist
User & Date: oehhar on 2018-07-02 10:24:28
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed 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 changed to: "8.6.8"
  6. is_private changed to: "0"
  7. login: "oehhar"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "oehhar"
  14. subsystem changed to: "15. Dict Object"
  15. title changed to:
    "dict unset d key subkey" fails if key does not exist
    
  16. type changed to: "Bug"