The documentation for (system) states:

"The resulting process writes to (current-output-port), reads from 
(current-input-port), and logs errors to (current-error-port)."

So, I'm guessing that it may be waiting for input. The following does not 
require an extra enter key:

(parameterize ([current-input-port (open-input-string "")])
  (with-output-to-string (lambda () (system "ls"))))

Also, DrRacket doesn't require an extra enter key, so maybe there is 
something going on unique to the command line REPL.

On Sunday, December 13, 2020 at 5:19:56 PM UTC-5 mlist...@gmail.com wrote:

> Hi,
>
> I wonder why I need to press ENTER *twice *in the racket REPL for this 
> command:
>
> racket
> Welcome to Racket v7.9 [bc].
> > (with-output-to-string (lambda () (system "ls")))
>
> "a.rkt\nfuncs.rkt\nliteral.rkt\nparser.rkt\nparser-test.rkt\nt.rkt\ntuvalu.rkt\n"
>
> >
>
> It executes normally if I run this in a Racket  script as below:
>
> #lang racket
> (with-output-to-string (lambda () (system "ls")))
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87990541-c13d-4aa9-add3-b695375e9a86n%40googlegroups.com.

Reply via email to