Lisp HUG Maillist Archive

cl-json delivery dependency to lisp reader

Hi everyone!

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?

PS. I will also send a similar message to the cl-json list, if that is more appropriate.

Thanks!
Sven Emtell

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: cl-json delivery dependency to lisp reader

Just want to report that I got this response from the cl-json list.
/Sven

---
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*.
---

31 okt 2012 kl. 18:28 skrev Sven Emtell:

> 
> Hi everyone!
> 
> 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?
> 
> PS. I will also send a similar message to the cl-json list, if that is more appropriate.
> 
> Thanks!
> Sven Emtell
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: cl-json delivery dependency to lisp reader



On Fri, Nov 2, 2012 at 10:03 AM, Tim Bradshaw <tfb@cley.com> wrote:

On 2 Nov 2012, at 08:09, Sven Emtell wrote:
>
> ---
> 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).

I didn't look very hard, but that code seems to call READ-FROM-STRING without any real precautions at all (in particular no matter how careful it is to be sure that the syntax is "good" it just appears to live in hope that the readtable is not full of explosives).  May be I did not check carefully enough (I hope not).


There are at least two libraries available via quicklisp that look like they may be used: "parse-float" and "parse-number".
Updated at: 2020-12-10 08:36 UTC