(begin (import chicken.port chicken.repl) (define (testport) (let ((input (string->list "(+)5"))) (print* "*** running with input ") (write input) (newline) (make-input-port (let ((b input)) (lambda () (cond ((pair? b) (let ((c (car b))) (set! b (cdr b)) (print* "JUST READ ") (write c) (newline) c)) (else #!eof)) )) (lambda () #t) (lambda () #f)))) ;; read seems to work (5 is never read) (with-input-from-port (testport) read) ;; repl reads the 5 before calling eval, why? (with-input-from-port (testport) (lambda () (repl (lambda (x) (print "EVAL ON " x) (eval x))))))