[racket] Input Issues
I just saw the string Alexandre Moreira started a few days ago. No need to
repeat anything from there. I guess it's just worth noting that he isn't
the only one that wants to (read-line) from a function invoked on the REPL.
My use case is similar to his. I have functions that take several
arguments. It's easier on the human brain to ask for the data through a
series of prompts instead of using a long function call. I'm also toying
with the idea of using readline to add tab completion to some of my prompts.
I haven't tried Readline, yet, though.
- Bill
On Mon, Jan 10, 2011 at 8:36 PM, Bill Hager
<whager+plt at gmail.com<whager%2Bplt at gmail.com>
> wrote:
> Hi All.
>
> I'm having an issue with (read-line). Below is some output from running
> the attached rkt file on my system(Ubuntu 10.10, Racket 5.0.2). In the
> first instance the script runs, and as I expect I can enter a string such as
> "Hello". When I use the repl it does not work like I expect it to, and I
> don't get a chance to enter a string. Any ideas? I thought about
> flushing/discarding data from the input port before calling (read-line), but
> I only found a function for flushing an output port.
>
> Thanks!
>
> bash$ racket -l scheme -t "read-test.rkt" -e "(read-input)"
> Enter a string: Hello
> "Hello"
> bash$ racket
> Welcome to Racket v5.0.2.
> > (require "read-test.rkt")
> > (read-input)
> Enter a string: ""
> >
>
> - Bill
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110110/e9378500/attachment.html>