On Wed, Oct 31, 2012 at 5:07 PM, Sven Emtell sven.emtell@doremir.com wrote:
I use cl-json with LispWorks 6.1. When delivering an app, I am trying to minimize the size of it by setting delivery level 5. The cl-json function "decode-json-from-string" does not seem to like this without explicitly keeping the Lisp Reader using the delivery keyword (:keep-lisp-reader). Since the Lisp Reader is unnecessary for the rest of the app, I would like to leave it out when delivering. Any thoughts on this?
The Lisp reader is used on just one occasion, namely, in the function PARSE-NUMBER in src/decoder.lisp (line 417ff., four uses of READ-FROM- STRING). You can easily ditch it by supplying another parser for numbers. For this end, you have three options: A) wait for someone to develop a replacement—without guarantees; B) write a replacement yourself, send a patch to the maintainers, and wait for it to be pushed to the repository; C) customize DECODE-JSON in your own code, by setting or binding the handlers for number token. If you choose option C, I'd suggest you read the relevant chapter in the User Guide (http://common-lisp.net/project/cl-json/#DECODER-CUSTOMIZATION). The handlers in question are represented by the variables *INTEGER- HANDLER* and *REAL-HANDLER*.
Sincerely, — B. Smilga.