ztcl::json
ztcl::json subcommand ?arg ...?
JSON: parse to Tcl values, read one value with no full parse, check, and write with a schema. An object is a dict, and an array is a list. Load it with package require ztcl::json.
This page also has ztcl::json::parse, ztcl::json::valid, ztcl::json::get, ztcl::json::exists, ztcl::json::encode, ztcl::json::object, ztcl::json::array, ztcl::json::string, ztcl::json::number, ztcl::json::bool, ztcl::json::null, ztcl::json::raw, ztcl::json::pretty.
Examples
A click on an example runs it in the shell of the page.
package require ztcl::json; ztcl::json parse {{"a": [1, 2]}}:a {1 2}ztcl::json encode -schema {object {n int}} {n 5}:{"n":5}
Facts
- Capability: none.
- Compute cost: one compute unit for the call, and more for the commands that it runs.
- The full page: ztcl::json.