(and (echo "," "}") (prin ".0" @) is so cool!
Actually my point about array was to read the numbers in the array as fixed
points decimals :) - 1, 2.0,3 -> with correct scaling.
Regards,
Kashyap





On Tue, May 7, 2019 at 8:05 AM Alexander Burger <a...@software-lab.de> wrote:

> On Tue, May 07, 2019 at 06:30:15AM -0700, C K Kashyap wrote:
> > 1. use (echo "\"volume\"") - this way any "volume" inside a string will
> not
> > be confused
>
> Yes, or even better include the colon "\"volume\":".
>
>
> > 2. use (echo "," "}") so that it works with values that are the last
> entry
> > in the dictionary
>
> Right! Then remember it locally to output again.
>
> Instead of
>
>    (echo ",")
>    (prin ".0,")
>
> you can do
>
>    (and (echo "," "}") (prin ".0" @)
>
> As a benefit, this also handles the case when no comma or brace is found
> (though
> it would be illegal Json then).
>
>
> > I feel that I may be pushing it - but is there some way I could deal with
> > an array too - {"somekey": [1, 2.0, 3]} :)
>
> 'readJson' handles arrays. It returns them as lists naturally. If you want
> to
> keep the info that it was an array, pass T to 'readJson', it will then
> mark the
> list with a T in the first element.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to