Is there a way to evaluate an arbitrary string from Scala, as if the same text was entered directly into the Scala REPL? I want to say that I would like to do something like this:
scala> eval("val x = 42") scala> x res2: Int = 42
Since the Scala REPL takes commands in an eval loop using jline (I guess) and then compiling / interpreting it, there should be a way to send an arbitrary line of text. I am ready to hack the Scala REPL if necessary.
source share