replete-repl / replete-ios

ClojureScript REPL iOS app
Eclipse Public License 1.0
395 stars 25 forks source link

[newbie issue] can you do console like programming in ios #134

Closed kwccoin closed 5 years ago

kwccoin commented 5 years ago

Working on land of lisp to clojure. As that is a console based book, I wonder whether you can do this here. That is can you ask input instead of I have to use a simulated one.

Trying

(Require 'replete.core) (do (print "What's your name? ") (flush) (replete.core.read-line))

` What's your name?

Execution error (ReferenceError) at (:1). Can't find variable: REPLETE_RAW_READ_STDIN `

Obviously need to handle read input stream but how to get this.

====

Try

` (def y (cljs.reader.read))

Execution error (Error) at (:1). Invalid arity: 0

`

Not sure how to proceed. Just want to get user input.

kwccoin commented 5 years ago

Similar to these lines:

` (defun add-five ()
(print "please enter a number:")
(let ((num (read)))
(print "When I add five I get")
(print (+ num 5))))

`

mfikes commented 5 years ago

Hi @kwccoin, we haven't yet implemented the ability to mimic stdin, which read-line would need.

kwccoin commented 5 years ago

Ok. I can still do many of those just no reader. Good tools and thanks.