Possible Duplicate:
Load Scala file into interpreter to use functions?
I start the sbt console like this:
alex@alex-K43U:~/projects$ sbt console
[info] Set current project to default-8aceda (in build file:/home/alex/projects/)
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.9.2 (OpenJDK Client VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
I have a test.scala
(/home/alex/projects/test.scala) file with something like this:
def timesTwo(i: Int): Int = {
println("hello world")
i * 2
}
How to do it so that I can do something like this in the console:
scala> timesTwo
And output the value of the function?