(define reader (make-thread (lambda () (let loop () (thread-wait-for-i/o! (port->fileno i)) (while (and (char-ready? i) (not (eof-object? (peek-char i)))) (printf "~a" (read-char i)) (flush-output)) (loop)))))