- scala> val xs:Stream[Int] = f(10)
- Called f(10)
- xs: Stream[Int] = Stream(10, <not computed>)
- scala> xs.take(4).toList
- Called f(11)
- Called f(12)
- Called f(13)
- res12: List[Int] = List(10, 11, 12, 13)
- scala> xs.take(4).toList
- res13: List[Int] = List(10, 11, 12, 13)
- scala> xs.take(6).toList
- Called f(14)
- Called f(15)
- res14: List[Int] = List(10, 11, 12, 13, 14, 15)