[cl-json-devel] cl-json 0.4

Boris Smilga boris.smilga at gmail.com
Mon Apr 13 17:18:53 UTC 2009


Good day to everyone.

The previous version of this message seems to have been swallowed by a
filter somewhere on the line, but if it has got through, I apologize for
double posting.

I have prepared patches to upgrade CL-JSON to the new version 0.4.0 which
incorporates changes we have been discussing of late.   The changes are
rather wide-scale (the sheer size of the patches is 415k), almost every
aspect of the implementation differs from what we had in version 0.3.1 and
earlier.  The most important points are:

1.  The decoder now has the customization mechanism from decoder-vars.lisp,
with imperative handlers and aggregate-scope variables.

2.  The encoder provides a streaming API (borrowed from YASON).  The
standard encode methods are re-implemented using that API.

3.  The CLOS decoder has undergone serious modifications to address the
issue of degrading performance in some Lisp implementations.  It shall be
possible to use anonymous “fluid” objects created by the decoder in a way
which makes for a “poor man's JavaScript”.  The CLOS encoder does not emit
prototype metadata anymore (unless specifically requested).

4.  I have written a new pair of matching functions to convert between camel
case and Lisp names.

5.  There is an improved exception signalling mechanism.  Some things which
previously were handled by callbacks now use conditions / restarts.

6.  JSON-BIND now uses the event-based decoder API with dynamic
customization.  This has the advantage that the user may choose the
semantics with which to decode interior values.  However, I had to forego
the support for Lisp trees as arguments to JSON-BIND.

7.  Some exported names were changed:
    Condition JSON-PARSE-ERROR → JSON-SYNTAX-ERROR
    Macro WITH-LIST-DECODER-SEMANTICS → WITH-DECODER-SIMPLE-LIST-SEMANTICS
    Macro WITH-CLOS-DECODER-SEMANTICS → WITH-DECODER-SIMPLE-CLOS-SEMANTICS

I have made sure the tests pass in Clozure CL, SBCL, CMUCL, CLisp, and ECL.

There is a new User's Manual in doc/cl-json.html (I have also uploaded a
copy to http://dpworks.net/smilga/cl-json.html).  And here I would like to
humbly ask someone on this mailing list who is a native speaker of English
to proof-read it.  Russian, my natural idiom, is quite unlike English in
grammar, conventional style, and punctuation.  Though I am more or less
fluent in the latter language, I never fully trust myself, especially with
the choice of articles, “which” vs. “that”, and the use of modal and
causative constructions.  Also, if you think some passages confused or
inarticulate, by all means do not hesitate to point me to them.  Thank you
in advance.

As I suppose that it was the size of the attachment which has led to the
previous message being blocked, I'm going to try to send it in a separate
message, and if that fails the file can be downloaded from
http://dpworks.net/smilga/cl-json-version-0.4.dpatch.gz.

Sincerely,
 - B. Smilga.




More information about the cl-json-devel mailing list