(use srfi-18) (use posix) (define (produce writer) (thread-start! (lambda () (let loop ((i 0)) (display (conc "hello" i " ") writer) (flush-output writer) (loop (+ i 1)))))) (define (consume reader) (thread-start! (lambda () (let loop () (print (read reader)) (loop))))) (define (stream-test in-fd out-fd) (let ((reader (open-input-file* in-fd)) (writer (open-output-file* out-fd))) (produce writer) (print "producer started") (thread-join! (consume reader)))) (define dothis (call-with-values create-pipe stream-test)) (dothis)