Skip to content

Instantly share code, notes, and snippets.

View tokunbo's full-sized avatar
📈
stoNkz only go up

Tokunbo George tokunbo

📈
stoNkz only go up
View GitHub Profile
/*
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