title: How to load a scala file in the sbt console?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7383436/load-scala-file-into-interpreter-to-use-functions">Load Scala file into interpreter to use functions?</a>  </p>
  </blockquote>
  
  
  
  <p>I start the sbt console like this:</p>
  
  <pre><code>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&gt;
  </code></pre>
  
  <p>I have a <code>test.scala</code> (/home/alex/projects/test.scala) file with something like this:</p>
  
  <pre><code>def timesTwo(i: Int): Int = {
    println("hello world")
    i * 2
  }
  </code></pre>
  
  <p>How to do it so that I can do something like this in the console:</p>
  
  <pre><code>scala&gt; timesTwo
  </code></pre>
  
  <p>And output the value of the function?</p>