This program works fine in DrRacket :
(define (display-state input data)
input)
(define (update-state input data)
data )
(define (main input data)
(displayln (display-state input data))
(main (read-line (current-input-port) 'any) (update-state input data)))
(main "" data)
It's the skeleton of a program that reads continually from a terminal interaction and does something with the user's input and a data state.
However, on the terminal, using
raco exe prog.rkt
It terminates after the first input. Anyone know why? Is it a bug / feature of read-line or current-input-port ?