The use of (++ Value) instead of (pop 'Value) may be an improvement, but it breaks backward compatibility with older clients since the time you implemented (++ Value), so I can't accept that in my libraries just yet.. at least not until I'm certain I don't have any applications with older PicoLisp clients deployed in the wild.

Thanks.


AW

On Thu, 28 Mar 2019, Alexander Burger wrote:

Hi Kashyap,

I made a tiny change to support floating point (to be used with scaling
that is). I wanted to get it reviewed to confirm if I am not missing
something.

I added a condition to  json-parse-unicode in json.l
<https://github.com/aw/picolisp-json/blob/master/json.l>

If you mean this line

            [*(and (= "." (car Value))) (pop 'Value)  (link R '. (pop
'Value)) ]*

I think it is fine, though I have not studied the whole JSon library.

A minor improvement could be to replace all calls like (pop 'Value) with
(++ Value) which is a tiny little bit smaller and faster, but that's only
cosmetics.


But what REALLY nags me is that this code is still around:

 (local MODULE_INFO *Msg err-throw)
 (local json-parse-file json-parse-string json-parse-unicode 
json-count-brackets)
 ...

This is WRONG!! It is a pity that this is still public and being propagated as
an example! Please don't use it!

The correct syntax is:

 (local) (MODULE_INFO *Msg err-throw)
 (local) (json-parse-file json-parse-string json-parse-unicode 
json-count-brackets)
 ...

'local' takes NO arguments. It must read the symbols from the input stream.
Otherwise the symbols ARE already read when 'local' runs and will possibly
be found in the wrong namespace.

☺/ A!ex

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to