Reputation: 1594
I'm experimenting around a custom Lisp evaluator (reading Lisp in Small Pieces) in CLJS with Lumo.
Is there a way to ask the user for a string and then process it? Like the shell has read
or Python has input
.
Thanks.
Upvotes: 1
Views: 286
Reputation: 16060
You could use nodejs readline package:
(def readline (js/require "readline"))
(def rl (.createInterface readline #js {:input (.-stdin js/process) :output (.-stdout js/process)}))
(.question rl "ok?" pr)
Upvotes: 2