unsubscribe
unsubscribe -- Steve Rogers http://www.linkedin.com/in/shrogers “"Don't worry about what anybody else is going to do… The best way to predict the *future* is to *invent* it."* -*- Alan Kay
Re: Review request for my JSON parsing implementation
On Fri, May 10, 2019 at 07:19:06AM -0700, C K Kashyap wrote: > Interestingly sub? also seems to work like member? Ah, right. I forgot. 'sub?' is rather tolerant, it accepts also non-symbolic values and converts them silently to transients ;) > member? is clearly the appropriate one. Yes, and has no such conversion overhead. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Review request for my JSON parsing implementation
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 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 >
Re: Review request for my JSON parsing implementation
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