Thanks Alex,
"apply" is what I was looking for :)
Interestingly sub? also seems to work like member? for list of chars - but
member? is clearly the appropriate one. I think trim is required because
this is valid {"K1": 10 , "K2": 20    }

Regarding the download logic - the idea is to cache the output and fetch
only if the cache does not exist or "Online" (Onl) is True. But I agree
that it does conflate ideas.

Regards,
Kashyap

On Thu, May 9, 2019 at 11:06 PM Alexander Burger <a...@software-lab.de>
wrote:

> On Fri, May 10, 2019 at 07:38:22AM +0200, Alexander Burger wrote:
> >    (de getJson (Spl File Url Oln)
> >       (when (or Oln (not (info File)))
> >          (wget Url) )
> >       (pipe
> >          (in File
>
> I think this whole construct is not wise. What if the file fetched with
> 'wget'
> has a different name?
>
> Perhaps separate this logic from this function? And why store it in a file
> at
> all, instead of directly reading from the pipe?
>
> You could analyze the file, and if it looks like an URL then
> fetch it:
>
>    (de getJson (Spl File)
>       (pipe
>          (in
>             (if (or (pre? "http://"; File) (pre? "https://"; File))
>                (list "curl" "-s" File)
>                File ) )
>          (while (prin (apply echo Spl))
>             ....
>
> ☺! A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to