[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Should http-client automatically consume unconsumed
Re: [Chicken-users] Should http-client automatically consume unconsumed input? [Was: Re: ssax examples could not run]
Wed, 22 Jun 2011 21:38:10 +0200
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:
#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*
"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