I'm trying to get read-char to read a character as soon as it is typed, but read-char insists on buffering the input until a carriage return is entered. The Racket reference says that the buffer mode is controlled by file-stream-buffer-mode, but it seems to have no effect. (More confusingly, the doc says that line buffering, which I think is the behavior I'm seeing, is not allowed on input ports.) Here's the code:
(require (lib "mzlib/etc")) (file-stream-buffer-mode (current-input-port) 'none) (define (pushpull) (define (helper indent) (printf "~aX~n" (make-string indent #\space)) (helper ((case (read-char) ((#\l) add1) ((#\j) sub1) (else identity)) indent))) (helper 0)) (pushpull) Thanks for helping, RM
_________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users