This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
You'll see all kinds of different programatic scala REPL solutions out there, but for me they all have at least one of the following problems: | |
- Crash before prompt appears if you previously used repl.intp.bind before starting it. | |
- Prompt appears but every command crashes | |
- Works but no access to variables before the REPL started | |
- Works... but intermittently | |
....After a bunch of testing, I eventually reached the conclusion that the repl.intp isn't ready yet... so I start a Future | |
that'll bind the variable 2 seconds after the repl starts. So far this has been the reliable method. | |
*/ | |
import scala.tools.nsc.interpreter.ILoop |