Hi Luis,

> In the above example, I used `in` and the call to `parseLink` works fine.


> But
> (client "picolisp.com" 80 "wiki/?home"
>    (while (from "<a href=\"")
>       (parseLink (till "<"))))
> does not.  AFAICT, each while cycle returns a list which in my view
> would be used as an argument to `parseLink`, but it doesn't work as I
> expect.  `in` opens an input channel, `client` seems to me to return a
> list.

Hmm, as I said, it depends on what 'parseLink' does. However the lists
of characters (i.e. the chopped URLs) should be passed.

I tried this:

   (client "picolisp.com" 80 "wiki/?home"
         (while (from "<a href=\"")
            (link (till "<" T)) ) ) )

and get a list of strings.

> I tried to save the whole html file with a `out`, before the `client`
> ...
> (out "hh.html"
>    (client "picolisp.com" 80 "wiki/?home"))

This is not a good idea, because 'client' opens its own 'out' back to
the server. You need it inside of 'client', e.g.

   (client "picolisp.com" 80 "wiki/?home"
      (out NIL (echo)) )

BTW, this is the most basic call to see what 'client' does.

> Also tried to append to a file with each iteration:
> (client "picolisp.com" 80 "wiki/?home"
>    (while (from "<a href=\"")
>       (out "+hh.html"
>          (msg (till "<")))))

Hmm, this is also not a good idea. 'msg' prints to stderr, so nothing
gets printed into "hh.html".

Besides this, the (out "+xxx) is OK, however quite some overhead because
it is re-opened and closed all the time. Better would be

   (client ..
      (out "hh.html"
         (while (from "...
            (println (till "<")) ..

This will print the lists to the file.

> Frustation is high right now... :-(

Sorry to hear that! But I think we are getting closer ;)
♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to