Repl
by {"name"=>"Vuyisile Weni"}
A Read–Eval–Print Loop (REPL)
is an interactive computer programming environment that takes single user inputs, evaluates them, and quickly returns the result to the user.
A program written in a REPL environment is executed piecewise ( is a function which is defined by multiple sub-functions, each sub-function applying to a certain interval of the main function’s domain).
The term is most usually used to refer to programming interfaces similar to the classic Lisp machine interactive environment. Common examples include command line shells and similar environments for programming languages, and is particularly characteristic of scripting languages.
- The read function accepts an expression from the user, and parses it into a data structure in memory.
- The eval function takes this internal data structure and evaluates it.
- The print function takes the result yielded by eval, and prints it out to the user. If it is a complex expression, it may be pretty- printed -to make it easier to understand.
- The development environment then returns to the read state, creating a loop, which terminates when the program is closed.