chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Should http-client automatically consume unconsumed


From: Peter Bex
Subject: Re: [Chicken-users] Should http-client automatically consume unconsumed input? [Was: Re: ssax examples could not run]
Date: Wed, 22 Jun 2011 21:38:10 +0200
User-agent: Mutt/1.4.2.3i

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]