Yeah ... and each line is lot fewer than 80 characters :)
just to confirm that I got it - I believe that a couple of changes are
needed to make it work better -
1. use (echo "\"volume\"") - this way any "volume" inside a string will not
be confused
2. use (echo "," "}") so that it works with values that are the last entry
in the dictionary

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]} :)

Regards,
Kashyap





On Tue, May 7, 2019 at 3:45 AM Guido Stepken <gstep...@gmail.com> wrote:

> Some also call it "REST" and have written mighty libraries in other
> languages.
>
> In PicoLisp it's a 5 - liner! ;-)
>
> Alexander Burger <a...@software-lab.de> schrieb am Di., 7. Mai 2019, 07:04:
>
>> On Mon, May 06, 2019 at 02:06:56PM -0700, C K Kashyap wrote:
>> > My mind is blown - yet again. I love it just looking at it. I'll have to
>> > look a little more to see what's going on.
>> >
>> > How do I capture the output though - I mean this does not capture the
>> > output in J
>>
>> I used 'pretty' in the example to view the result.
>>
>> You can directly 'setq' it or use it in whatever way of course.
>>
>>    (let J
>>       (pipe
>>          (in '("curl" "-s" "
>> https://api.iextrading.com/1.0/stock/aapl/chart/3m";)
>>             (while
>>                (prin
>>                   (echo "volume" "unadjustedVolume") )
>>                (echo ",")
>>                (prin ".0,") ) )
>>          (readJson) )
>>       ....
>>       (doSomething J)
>>       ... )
>>
>> ☺/ A!ex
>>
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>

Reply via email to