Tcl Library Source Code

Ticket Change Details
Login
Overview

Artifact ID: 326e35ccd992427ec359f57735296cc7a2aa110c
Ticket: 2df194042b2acd13c60b0dd92cdf55c1a0ef3bde
json2dict does not always produce a dictionary
User & Date: nmadden 2015-01-16 10:20:31
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    The json::json2dict procedure is named and documented as if it produces a dictionary output in all cases. This is incorrect, as per these examples where the output is a string/number/list:
    
    % package require json
    1.3.3
    % json::json2dict {true}
    true
    % json::json2dict {1234.45}
    1234.45
    % json::json2dict {"Hello, World!"}
    Hello, World!
    % json::json2dict {[1,2,3,4]}
    1 2 3 4
    
    The documentation (and ideally the name) should be updated to make clear that it only returns a dictionary if the input is a JSON object, and that the caller *must know* the type of JSON data being parsed in order to know how to interpret the result correctly. I have seen several questions on TkChat and c.l.t that suggest that this is confusing people.
    
  5. foundin changed to: "1.3.3"
  6. is_private changed to: "0"
  7. login: "nmadden"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "4d3bc24d727f6c89fb1509fef02f21887282efcc"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "nmadden"
  14. subsystem changed to: "json"
  15. title changed to: "json2dict does not always produce a dictionary"
  16. type changed to: "Bug"