Forum OpenACS Development: Re: Error: invalid command name "json::json2dict"

Posted by Gustaf Neumann on

you seem to mix up the APIs of the various json implementations for Tcl. If you want to use rl_json, use "json get ..." [1]. If you want to use tdom to parse json, use "dom parse -json ..." [2]. If you want to use tcllib's json implementation, use "::json::json2dict ..." [3]. In your snippet above, you seem to use pieces of all of these.

The reason, you are seeing the error message 'invalid command name "json::json2dict"' is that "package require json" is missing (see [3]) is missing in your script.



Posted by Iuri Sampaio on
Indeed. A total mess! I was writing [1], [2] and [3], in the same script in order to evaluate all methods to parse a json input, then I made confusion with variable names.

I must avoid that bu commenting the code I write. Thanks

Btw, after I've cleaned the snnipet and added "package require json", the error is gone.

Best wishes,