CL-JSON

A JSON parser and generator in Common-Lisp.

What is JSON?

JSON is a language independent text format for data-interchange. JSON is especially convenient in web applications, since it is a subset of the literal object notation of ECMAScript. It can also be an alternative to XML. JSON has good open-source support in many languages.

Why not use XML instead?

  • Some find JSON lighter and more simple, see this comparison.
  • Why not use s-expressions instead?

    Mailing Lists

    Documentation

    You can use any of these functions:

        decode-json
        decode-json-strict
        decode-json-from-string
        encode-json
        encode-json-to-string
    
        json-bind, use like this:
    
    (test test-json-bind
      (json-bind (hello hi ciao) "{\"hello\":100,\"hi\":5}"
        (is (= hello 100))
        (is (= hi 5))
        (is-false ciao)))
    Json-rpc, implements the json-rpc specification. Easily add it to your favourite webserver.
        defun-json-rpc
        export-as-json-rpc
        clear-exported
        invoke-rpc
     
    Tweaking
        *json-symbols-package* Default keyword, set to a package or nil for current package.
        *json-object-factory* Change how objects are decoded to Lisp.
        *use-strict-json-rules*
     
    For examples, see the FiveAM based testcases.

    Where is it

    A Darcs repository is available.

    darcs get http://common-lisp.net/project/cl-json/darcs/cl-json
    

    The latest release can be downloaded here.

    You can also install it by asdf-install.

    History has shown that the darcs version is probably better than the latest release.

    Dependencies

    cl-json no longer depends on parenscript.

    License

    MIT-license

    Valid XHTML 1.0 Strict