0

I'd like to capture rebol console input line by line so as to act upon it in realtime like in nodejs with readline function : Reading value from console, interactively

Is this possible in rebol ?

user310291
  • 36,946
  • 82
  • 271
  • 487
  • Writing a repl is classically done with a combination of `forever` and `ask`. There's more than one way to do it of course.. – Geeky I Oct 10 '17 at 02:43

1 Answers1

3

Maybe like

until [name: ask "What's your name? " also name = "noname" print ["nice to meet you" name]]  

or

until [
    name: ask "What's your name? " 
    either empty? name [
       true
    ] [
       print ["nice to meet you" name]   
       false
    ]
] 

or

while [not empty? name: ask "What's your name? "][print ["nice to meet you" name]]  
sqlab
  • 6,412
  • 1
  • 14
  • 29