((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/json" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.")) (section 2 "json" (section 3 "Author" (p "Tony Garnock-Jones")) (section 3 "Requirements" (ul (li (link "http://wiki.call-cc.org/eggref/4/packrat" "packrat")))) (section 3 "Description" (p "This extension implements a parser and generator for the  " (link "http://www.json.org" "JSON") " data interchange format.") (p "See also " (int-link "json-abnf") " and " (int-link "medea") ".")) (section 3 "API" (def (sig (procedure "(json-write OBJECT [PORT])" (id json-write))) (p "Writes the Scheme data object " (tt "OBJECT") " in JSON format to " (tt "PORT") " which defaults to the value of " (tt "(current-output-port)") ". Scheme data is mapped to JSON format in the following way:") (table "\t" (tr (th (@ (align "left")) " Scheme") (th (@ (align "left")) "JSON")) "\n\t" (tr (td "Hash-table") (td "Structure")) "\n\t" (tr (td "Vector") (td "Structure (assuming vector consists of " (tt "(SYMBOL . DATA)") " pairs")) "\n\t" (tr (td "List") (td "Array")) "\n\t" (tr (td "Number") (td "Number")) "\n\t" (tr (td "Void") (td "Null")) "\n\t" (tr (td "String or symbol") (td "String")))) (def (sig (procedure "(json-read [PORT])" (id json-read))) (p "Reads data in JSON format from " (tt "PORT") " which defaults to the value of " (tt "(current-input-port)") ".") (p "Note that json-read does not produce alists, as the result are vectors and not lists, and keys are strings and not symbols."))) (section 3 "License" (pre "MIT\n\nCopyright (c) 2004, 2005 Tony Garnock-Jones <tonyg@kcbbs.gen.nz>\nCopyright (c) 2005 LShift Ltd. <query@lshift.net>\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use, copy,\nmodify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\nBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\nACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.")) (section 3 "Version history" (dl (dt "1.6") (dd "CHICKEN 5 support") (dt "1.5") (dd ".meta fixes") (dt "1.3") (dd "ported to CHICKEN 4") (dt "1.2") (dd "handling of unicode escapes [by Dan Muresan]") (dt "1.1") (dd "Bugfix to handle null") (dt "1.0") (dd "Initial release")))))