On Tue, Jun 21, 2011 at 09:53:45PM +0200, Peter Bex wrote:
> Hi again,
> 
> Also, about this piece of code:
> 
> > (pp (call-with-input-request
> >      "http://modis.ispras.ru/Lizorkin/XML/poem.xml";
> >      #f (lambda (p)
> >           (let ((sxml (ssax:xml->sxml p '())))
> >             ;; Consume the rest of the stream, ssax does not
> >             ;; fully read until the end.
> >             (read-string #f p)
> >             sxml))))
> 
> Does it make sense to have http-client automatically consume any
> remaining data after the user-supplied reader returns?
> What about continuations?  Or perhaps it should be read when the
> *next* request is done?

I've just implemented this in http-client trunk.

This means that it's now enough to do:

(pp (call-with-input-request
      "http://modis.ispras.ru/Lizorkin/XML/poem.xml";
      #f (lambda (p) (ssax:xml->sxml p '()))))

and there will be no error on the next request because of leftovers
from the previous request.

> Thoughts? Opinions?

Probably not, everyone keeps ignoring me anyway.  *mutters to himself
and wanders off in search of a beer*

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to