here is what i thought would be the correct and useful definition of nums fibonacci in scala:
lazy val fibs:Stream[Int] = 0
However, I get the following error:
fibs take 10 foreach println 0 1 java.lang.StackOverflowError at scala.collection.mutable.LazyBuilder.(LazyBuilder.scala:25) at scala.collection.immutable.Stream$StreamBuilder.(Stream.scala:492) at scala.collection.immutable.Stream$.newBuilder(Stream.scala:483) at...
I think zipped is not working correctly with threads? Any suggestions on how to make this work, or why it doesn't work (shouldn't?)?
list scala stream infinite fibonacci
Felix
source share