[racket] REPL and read-line

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jan 6 14:20:16 EST 2011

At Thu, 6 Jan 2011 16:09:49 -0200, Alexandre Moreira wrote:
> I'm trying to use the (read-line) function in
> racket's REPL  and I'm having a weird problem. Whenever I type
> (read-line) in the REPL prompt it returns the empty string. It's as if
> it is receiving the linefeed character I use to enter the command on
> the REPL.
> 
> Is this a known limitation or a bug or some stupidity on my part?

A known limitation. The REPL implemented by plain `racket' does not
separate the input stream for REPL expressions from the program's input
stream.

> If it's something with racket, do you guys know of any workaround?

DrRacket splits the expression and program-input streams, as Jos has
noted.

Offhand, I'm not aware of a tool that similarly splits input streams
within a terminal.



Posted on the users mailing list.