title: Does isEmpty method in Stream evaluate the whole Stream?
body: <p>In Scala, does calling <code>isEmtpy</code> method on an instance of <code>Stream</code> class cause the stream to be evaluated completely? My code is like this:</p>
  
  <pre><code>import Stream.cons
  
  private val odds: Stream[Int] = cons(3, odds.map(_ + 2))
  private val primes: Stream[Int] = cons(2, odds filter isPrime)
  
  private def isPrime(n: Int): Boolean = n match {
    case 1 =&gt; false
    case 2 =&gt; true
    case 3 =&gt; true
    case 5 =&gt; true
    case 7 =&gt; true
    case x if n % 3 == 0 =&gt; false
    case x if n % 5 == 0 =&gt; false
    case x if n % 7 == 0 =&gt; false
    case x if (x + 1) % 6 == 0 || (x - 1) % 6 == 0 =&gt; true
    case x =&gt; primeDivisors(x) isEmpty
  }
  
  
  import Math.{sqrt, ceil}
  private def primeDivisors(n: Int) =
    primes takeWhile { _ &lt;= ceil(sqrt(n))} filter {n % _ == 0 }
  </code></pre>
  
  <p>So, does the call to <code>isEmpty</code> on the line <code>case x =&gt; primeDivisors(x) isEmpty</code> cause all the prime divisors to be evaluated or only the first one?</p>