is it possible to start the scala repl in Kojo with options such as -deprecation, -power, etc.
Date: 07 Dec 2014 23:01
Number of posts: 4
RSS: New posts
Kojo uses the following mechanisms for running code:
- the scala compiler (with a custom launcher), via the Run button; deprecation is on for the compiler.
- the scala interpreter, via the Run as Worksheet button; deprecation is off for the interpreter.
So deprecation should be on for you when run your code with the Run button.
Power mode is a layer on top of the core scala interpreter. It is currently not included in Kojo.
Btw, I have not used the power mode. What are the goodies it provides?
unfortunately those options are pretty much undocumented.
From what I understood :power is used
a) for dynamic interpretation of strings, e.g. intp.interpret("your command")
b) for reflection: http://stackoverflow.com/questions/15678616/getting-type-information-inside-scala-repl-via-imain
You have access to the following in Kojo:
kojoInterp - the scala interpreter
pcompiler - the scala presentation compiler
compiler - the scala compiler
You can use these to interpret code, and do reflection etc. These should be used from the default Kojo thread (and not from threads that you create in your script). Kojo also has a builtin interpret command that can be used from any thread.
All of this is meant to be used only by power users!