- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
2.9.0.1 <> 2.9.1.RC3 Interpreter regression
Fri, 2011-08-19, 08:16
Hi all,
I found an interpreter regression in 2.9.1.RC3. But maybe I'm just
doing it wrong with the new version.
dk@dkwork:~/Desktop/Test$ scala -version
Scala code runner version 2.9.0.1 -- Copyright 2002-2011, LAMP/EPFL
dk@dkwork:~/Desktop/Test$ cat InterpreterTest.scala
import tools.nsc.Settings
import tools.nsc.interpreter.IMain
object InterpreterTest {
def main(args: Array[String]) {
val settings = new Settings()
settings.usejavacp.value = true
val m = new IMain(settings)
m.interpret("val x = 42")
println(m.valueOfTerm("x"))
}
}
dk@dkwork:~/Desktop/Test$ scala -version
Scala code runner version 2.9.0.1 -- Copyright 2002-2011, LAMP/EPFL
dk@dkwork:~/Desktop/Test$ scala InterpreterTest.scala
x: Int = 42
Some(42) //THIS IS GOOD
////////////////// Now with scala 2.9.1.RC3
dk@dkwork:~/Desktop/Test$ ~/tools/scala-2.9.1.RC3/bin/scala -version
Scala code runner version 2.9.1.RC3 -- Copyright 2002-2011, LAMP/EPFL
dk@dkwork:~/Desktop/Test$ ~/tools/scala-2.9.1.RC3/bin/scala
InterpreterTest.scala
x: Int = 42
None // THIS IS NOT GOOD
BTW: Interpreter startup time is amazing now! Many thanks!
Daniel
This issue has already been reported:
https://issues.scala-lang.org/browse/SI-4899
Sorry for the noise.
On Aug 19, 9:16 am, Daniel wrote:
> Hi all,
>
> I found an interpreter regression in 2.9.1.RC3. But maybe I'm just
> doing it wrong with the new version.
>
> dk@dkwork:~/Desktop/Test$ scala -version
> Scala code runner version 2.9.0.1 -- Copyright 2002-2011, LAMP/EPFL
> dk@dkwork:~/Desktop/Test$ cat InterpreterTest.scala
> import tools.nsc.Settings
> import tools.nsc.interpreter.IMain
>
> object InterpreterTest {
> def main(args: Array[String]) {
> val settings = new Settings()
> settings.usejavacp.value = true
> val m = new IMain(settings)
> m.interpret("val x = 42")
> println(m.valueOfTerm("x"))
> }
>
> }
>
> dk@dkwork:~/Desktop/Test$ scala -version
> Scala code runner version 2.9.0.1 -- Copyright 2002-2011, LAMP/EPFL
> dk@dkwork:~/Desktop/Test$ scala InterpreterTest.scala
> x: Int = 42
> Some(42) //THIS IS GOOD
>
> ////////////////// Now with scala 2.9.1.RC3
>
> dk@dkwork:~/Desktop/Test$ ~/tools/scala-2.9.1.RC3/bin/scala -version
> Scala code runner version 2.9.1.RC3 -- Copyright 2002-2011, LAMP/EPFL
> dk@dkwork:~/Desktop/Test$ ~/tools/scala-2.9.1.RC3/bin/scala
> InterpreterTest.scala
> x: Int = 42
> None // THIS IS NOT GOOD
>
> BTW: Interpreter startup time is amazing now! Many thanks!
>
> Daniel