Welcome! Please see the About page for a little more info on how this works.

+1 vote
in REPL by
retagged by

Repro:

λ clj -Srepro -M -r
Clojure 1.10.3
user=> (read-line)
Hello, world!
"Hello, world!"
user=> (clojure.core.server/io-prepl)
(read-line)
{:tag :ret, :val "\"\"", :ns "user", :ms 2, :form "(read-line)"}

Notice how with io-prepl, (read-line) returns immediately without awaiting for user input and returns an empty string.

Calling either clojure.main/skip-if-eol or clojure.main/skip-whitespace after read+string in clojure.core.server/prepl appears to fix the issue, but it is admittedly unclear to me why that is.

1 Answer

+1 vote
by
selected by
...