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

Collapse
Posted by Gustaf Neumann on
yes, the "util::json::*" interface as part of acs-tcl should not be used anymore and should be deprecated, when we have a replacement.

The best candidate is IMHO tdom 0.9* with its json support, since tdom is already a prerequirement for all OpenACS installations. Maybe we should add some ad_json2dict (or similar with a namespace prefix) to OpenACS, where we can add the tcllib function as a fallback, when tdom 0.9+ is not available. ... then the old interface can be deprecated.

Collapse
Posted by Brian Fenton on
That sounds great, Gustaf! In the meantime, I must take a look at tdom's json support.

cheers
Brian

Collapse
Posted by Gustaf Neumann on

...or use in the meantime tcllib:

package require json
::json::json2dict  {{"firstName""Gustaf""secondName""Neumann""country""Austria"}}
I haven't used tDOM's JSON support in real life -- but will add that the performance of rl_json::* on larger documents has impressed me a lot. Particularly compared to poor options for parsing, type management and consistency offered by the combinations of json2dict/huddle in tcllib.