--- JSON-XS/README 2010/03/11 17:36:09 1.34 +++ JSON-XS/README 2010/03/11 19:31:37 1.35 @@ -58,10 +58,11 @@ * round-trip integrity When you serialise a perl data structure using only data types - supported by JSON, the deserialised data structure is identical on - the Perl level. (e.g. the string "2.0" doesn't suddenly become "2" - just because it looks like a number). There minor *are* exceptions - to this, read the MAPPING section below to learn about those. + supported by JSON and Perl, the deserialised data structure is + identical on the Perl level. (e.g. the string "2.0" doesn't suddenly + become "2" just because it looks like a number). There *are* minor + exceptions to this, read the MAPPING section below to learn about + those. * strict checking of JSON correctness @@ -672,6 +673,11 @@ the scalar context case. Note that in this case, any previously-parsed JSON texts will be lost. + Example: Parse some JSON arrays/objects in a given string and return + them. + + my @objs = JSON::XS->new->incr_parse ("[5][7][1,2]"); + $lvalue_string = $json->incr_text This method returns the currently stored JSON fragment as an lvalue, that is, you can manipulate it. This *only* works when a preceding @@ -896,6 +902,11 @@ ability, but the JSON number will still be re-encoded as a JSON number). + Note that precision is not accuracy - binary floating point values + cannot represent most decimal fractions exactly, and when converting + from and to floating point, JSON::XS only guarantees precision up to + but not including the leats significant bit. + true, false These JSON atoms become "JSON::XS::true" and "JSON::XS::false", respectively. They are overloaded to act almost exactly like the @@ -981,6 +992,13 @@ Tell me if you need this capability (but don't forget to explain why it's needed :). + Note that numerical precision has the same meaning as under Perl (so + binary to decimal conversion follows the same rules as in Perl, + which can differ to other languages). Also, your perl interpreter + might expose extensions to the floating point numbers of your + platform, such as infinities or NaN's - these cannot be represented + in JSON, and it is an error to pass those in. + ENCODING/CODESET FLAG NOTES The interested reader might have seen a number of flags that signify encodings or codesets - "utf8", "latin1" and "ascii". There seems to be