JSON.pir - PIR implementation of JSON data interchange format.
# generate a JSON representation of a PMC.
$S0 = _json( $P0 )
# generate a PMC from a JSON representation:
$P1 = _json_to_pmc( "[1,2,3]" )
#$P1 is now a array-like container PMC with three Integer elements.
PIR implementation of JSON
This library provides the following functions:
- (string) = _json(pmc, ?pretty )
- Convert a PMC to a JSON-serialized string. Note: If you pass in a cyclic structure, JSON will eventually throw a maximum recursion depth exception.
- Required. The PMC to dump.
- Optional. Boolean: If true, then the generated string will be very readable for humans. Defaults to false, which will generate the most compact string possible.
- (pmc) = _json_to_pmc(string)
- Given a JSON string, return a PMC that represents that data.
- Required. A JSON data string.
- The following PMCs are used when unmarshalling a JSON string: ResizablePMCArray, Hash, String, Integer, Float, Boolean, Null.
- implement _jsan_to_pmc - Jerry Gay was rolling some PGE to do the heavy lifting here.
- Thunk a better way to deal with the maximum recursion depth exception (Or make it official)