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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 = truemay suffice.You can see the interpreter in action here: http://www.simplex3d.org/console/