print prompt and get user input. If the prompt is ø, get a single character
Parameters
input prompt :null :string
Attributes
repl
get input as if in a REPL
history
:string
set path for saving history
complete
:block
use given array for auto-completions
hint
:dictionary
use given dictionary for typing hints
Returns
:char
:string
Examples
copy
name: input "What is your name? "
; (user enters his name: Bob)
print ["Hello" name "!"]
; Hello Bob!
copy
; creating a simple REPL
while [true][
inp: input.repl
.history: "myhistory.txt"
.complete:["Hello there", "Hello world!"]
.hint:#[he: "perhaps you want to say hello?"]
"## "
print ["got:" inp]
]
; will show a REPL-like interface, with arrow navigation enabled
; show previous entries with arrow-up, store entries in
; a recoverable file and also use autocompletions and hints
; based on give reference
copy
character: input ø
; (User types a key, for example "A")
print character
; A