Welcome to the CHICKEN Scheme pasting service

generator/continuation added by arew on Sat Aug 8 14:58:41 2020

    (define (http-request-chunked-body-generator generator)

      (define chunks #f)

      (define (next-chunk)
        (call-with-values chunks
          (lambda (symbol extensions-or-headers . maybe-chunk)
            (case symbol
              ((chunk)
               (set! continue (generator/continuation (car maybe-chunk)
                                                      next-chunk))
               (continue))
              ((headers) (set! continue eof-object?) (eof-object))))))

      (define (start)
        (set! chunks (http-request-chunks-generator generator))
        (next-chunk))

      (define continue start)

      (lambda ()
        (continue)))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the result of `(let ((spammers 'dumb)) spammers)'?
Visually impaired? Let me spell it for you (wav file) download WAV