title: Cannot compile file in Scala
body: <p>From an example in book "Begining in Scala", the script is:</p>
  
  <pre><code>import scala.collection.mutable.Map
  
  object ChecksumAccumulator {
   private val cache=Map[String,Int]()
   def calculate(s: String):Int =
     if(cache.contains(s))
       cache(s)
     else{
       val acc = new ChecksumAccumulator
       for(c &lt;- s)
         acc.add(c.toByte)
       val cs=acc.checksum
        cache+= (s -&gt; cs)
       cs
    }
  }
  </code></pre>
  
  <p>but, when I tried to compile this file
  $scalac ChecksumAccumulator.scala, then generate an error, "not found: type ChecksumAccumulator val acc = new ChecksumAccumulator", any suggest?</p>
  
  <p>Thanks,</p>