From: Matt S Trout Date: Tue, 19 Jun 2012 18:00:50 +0000 (+0000) Subject: namespacify X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0fcbbbfbf6fef02d4498962e945f063337033fa8;p=scpubgit%2FTenDotTcl.git namespacify --- diff --git a/json.tcl b/json.tcl index bb7a155..7503515 100644 --- a/json.tcl +++ b/json.tcl @@ -223,6 +223,8 @@ namespace eval ten::json { } return $result } + + namespace export parse_json deparse_json tclify_json } set ex_json { list {str foo} {num 0} {obj __remote_object__ {str 512}} {null} } @@ -238,12 +240,14 @@ set jtext { ] } -puts [ ten::json::deparse_json $ex_json 2 ] +namespace import ten::json::* + +puts [ deparse_json $ex_json 2 ] -dict for {k v} [ ten::json::tclify_json [ - lindex [ ten::json::tclify_json $ex_json ] 2 +dict for {k v} [ tclify_json [ + lindex [ tclify_json $ex_json ] 2 ] ] { puts "$k: $v" } -puts [ ten::json::parse_json $jtext ] +puts [ parse_json $jtext ] -puts [ ten::json::parse_json {["foo",2345,["bar"]]} ] +puts [ parse_json {["foo",2345,["bar"]]} ]