repl reads 1 byte beyond s-expr pasted by klm` on Tue Oct 29 20:50:06 2019

(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))))))

no title added by klm` on Tue Oct 29 20:51:35 2019

on chicken 5.1.0, I get:

*** running with input (#\( #\+ #\) #\5)
JUST READ #\(
JUST READ #\+
JUST READ #\)
*** running with input (#\( #\+ #\) #\5)
JUST READ #\(
JUST READ #\+
JUST READ #\)
JUST READ #\5
EVAL ON (+)
0
EVAL ON 5
5