(define (http-response-line-read generator) (define version '()) (define status-code '()) (define reason '()) ... (let loop ((k method-read) (char (generator))) (when (eof-object? char) (raise (make-http-error "http-request-line truncated!" #f))) (call-with-values (lambda () (k (integer->char char))) (lambda (continue? continuation) (if continue? (loop continuation (generator)) (values (list->string (reverse method)) (list->string (reverse uri)) (apply cons (reverse version))))))))