input

print prompt and get user input. If the prompt is ø, get a single character


Parameters

input prompt :null :string

Attributes

replget input as if in a REPL
history:stringset path for saving history
complete:blockuse given array for auto-completions
hint:dictionaryuse 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

Related