Skip to content
Sxtanna edited this page Jul 9, 2020 · 3 revisions

The pull keyword is a high level construct for reading console input.

Syntax

pull{::['type']}{("'text prompt'")}

  1. pull
  • Pull statements begin with the pull keyword.
  1. type (optional)
  • Pull statements can define a specific required type.
  • If the type does not match, the program will attempt to read input until it does.
  1. text prompt (optional)
  • Pull statements support printing a prompt before accepting input.

Examples

val anyInput = pull // will accept any value, and will store it as a string
val intInput = pull::[Int]("please enter an integer: ")
push "You entered $intInput"