Re: Review request for my JSON parsing implementation

2019-05-05 Thread C K Kashyap
Interesting ... for some reason, I believed that PicoLisp did not contain a json parser !!! - perhaps because, a search for json on https://picolisp.com/wiki/?Documentation takes me to the external repositories section :) pipe is awesome :) - I was looking for just that. It occurred to me that

Re: Review request for my JSON parsing implementation

2019-05-05 Thread Alexander Burger
On Sat, May 04, 2019 at 11:27:28PM -0700, C K Kashyap wrote: > Thank you so much Alex ... What would it take to transform this code to > handle string as input instead of file stream? There are two ways: 1. To parse strings directly, then a different code is needed. As an example, see

Re: Review request for my JSON parsing implementation

2019-05-05 Thread C K Kashyap
Thank you so much Alex ... What would it take to transform this code to handle string as input instead of file stream? On Sat, May 4, 2019 at 11:17 PM Alexander Burger wrote: > On Sun, May 05, 2019 at 07:58:16AM +0200, Alexander Burger wrote: > > Hi Kashyap, > > > > > Gentle reminder :) > > ...

Re: Review request for my JSON parsing implementation

2019-05-05 Thread Alexander Burger
On Sun, May 05, 2019 at 07:58:16AM +0200, Alexander Burger wrote: > Hi Kashyap, > > > Gentle reminder :) > ... > > > (while (not (= (peek) "\"")) > > Better (until (= (peek) "\"") Like what I said about 'prog', also 'not' should seldom be necessary. At least *never* in conditionals. ☺/

Re: Behavior of sort

2019-05-05 Thread JmageK
Copy appears to be most reliable as it does not modify the original list. Maybe a tiny bit slower than ->(setq L (sort L)) : (setq L (3 2 1 4 9 0] -> (3 2 1 4 9 0) : (sort (copy L] -> (0 1 2 3 4 9) : L -> (3 2 1 4 9 0)  : (setq L (sort L] -> (0 1 2 3 4 9) : L-> (0 1 2 3 4 9) JmageK --

Re: Review request for my JSON parsing implementation

2019-05-05 Thread Alexander Burger
Hi Kashyap, > Gentle reminder :) Yeah, good! :) I think it looks good, not much to say on a short glance. *If* anything at all, I would only mention minor stuff like > > (while (not (= (peek) "\"")) Better (until (= (peek) "\"") > > (case (peek) > >("\\" (char) (link