golo-lang
golo-lang copied to clipboard
REPL
It would be awesome to have a REPL (read eval print loop, i.e. an interactive interpreter) for Golo.
For simple single-line expressions, a simple while true readln + EvaluationEnvironment.run could do the trick, but being able to define functions, structures and augments in this top level repl would be very valuable.
Oh yes, that would be great :-)
I’ve already done some tests, but it’s a lot less obvious than it first seems…
- an anonymous module must be built incrementally
- the
mainshould be to just print the evaluation of the entered expression, of update the module if it is a declaration - the reader should be contextual, since we would like to be able to enter a definition expression spanning several lines
- …