summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interpreter/Power.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-12 21:59:11 +0000
committerPaul Phillips <paulp@improving.org>2011-07-12 21:59:11 +0000
commit0fac26971e78fbe79b2ba5aaa87bde63816ac028 (patch)
tree47f877ba76438a53047bd845c2ba9a0c918560ff /src/compiler/scala/tools/nsc/interpreter/Power.scala
parent70da5a627fe2ce15df64741b5784ed97c361a95e (diff)
downloadscala-0fac26971e78fbe79b2ba5aaa87bde63816ac028.tar.gz
scala-0fac26971e78fbe79b2ba5aaa87bde63816ac028.tar.bz2
scala-0fac26971e78fbe79b2ba5aaa87bde63816ac028.zip
Making power mode startup a little less glacial...
Making power mode startup a little less glacial, no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/Power.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/Power.scala15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/Power.scala b/src/compiler/scala/tools/nsc/interpreter/Power.scala
index 95e2e99dd1..95b42ebf69 100644
--- a/src/compiler/scala/tools/nsc/interpreter/Power.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/Power.scala
@@ -147,18 +147,19 @@ abstract class Power(
)
def init = customInit match {
- case Some(x) => List(x)
- case _ => initImports map ("import " + _)
+ case Some(x) => x
+ case _ => initImports.mkString("import ", ", ", "")
}
/** Starts up power mode and runs whatever is in init.
*/
def unleash(): Unit = beQuietDuring {
- val r = new ReplVals(repl)
- intp.bind("$r", r)
- r bindWithPrefix intp.pathToTerm("$r") // binds all the vals
-
- init foreach interpret
+ // First we create the ReplVals instance and bind it to $r
+ intp.bind("$r", new ReplVals(repl))
+ // Then we import everything from $r.
+ intp interpret ("import " + intp.pathToTerm("$r") + "._")
+ // And whatever else there is to do.
+ init.lines foreach (intp interpret _)
}
trait LowPriorityInternalInfo {