Based on a thread and the Scala interpreter sources it looks like it would not be that hard to get the equivalent of
def runLine(line: String): String
but has someone written this already?
There are many examples floating out there, but they may be hard to find. Here is the one I wrote a while back:
http://code.google.com/p/simplex3d/source/browse/trunk/Simplex3dConsole/src/simplex3d/console/SimpleInterpreter.scala?r=790
The tricky part is to get the interpreter to load Scala jars. I have loaded jars manually to make it work with web-start, but in your case, simple settings.usejavacp.value = true
may suffice.
You can see the interpreter in action here: http://www.simplex3d.org/console/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With