The REPL can be embedded and invoked programmatically.
It supports the javax.script
API, or it can be used
as either a code interpreter or an interactive command line.
This is a companion discussion topic for the original entry at http://docs.scala-lang.org//overviews/repl/embedding.html