title: Returning Value from Actor
body: <p>For the following Actor that checks divisibility by 3:</p>
  
  <pre><code>class CheckActor(actor: Actor) extends Actor {  
   println("created actor")
  
   var sum = 0
   def act = loop {
      react {
          case x:Int if (x % 3 == 0) =&gt; sum+=1
              ...
          case "calcSum" =&gt; sum
          case _ =&gt; 
      }
   }
  }
  </code></pre>
  
  <p>When I try to get the value of <code>sum</code> from the CheckActor instance...</p>
  
  <blockquote>
    <p><code>actor1 ! "calcSum" // actor1 is of type "CheckActor"</code></p>
  </blockquote>
  
  <p>I see this error on the type mismatch of sum1.</p>
  
  <pre><code>$&gt;scalac Count.scala
  Count.scala:38: error: type mismatch;
   found   : Unit
   required: Int
                  val sum1: Int = actor1 ! "calcSum"
                                         ^
  one error found
  </code></pre>