You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to Scala version 2.8.0.Beta1-RC1 (JavaHotSpot(TM) ClientVM, Java1.6.0_11).
Type in expressions to have them evaluated.
Type:help for more information.
scala>valfib:Stream[Int] =1 #::1 #:: fib.zip(fib.tail).map { case (a,b) => a + b }
fib:Stream[Int] =Stream(1, ?)
scala> fib take 10 toList
res1:List[Int] =List(1, 1, 2, 3, 5, 8, 13, 21, 34, 55)
scala>valfib:Stream[Int] =1 #::1 #:: (fib, fib.tail).zipped.map(_ + _)
fib:Stream[Int] =Stream(1, ?)
scala> fib take 10 toList
java.lang.StackOverflowError
at scala.collection.mutable.LazyBuilder.<init>(LazyBuilder.scala:23)
at scala.collection.immutable.Stream$$StreamBuilder.<init>(Stream.scala:427)
at scala.collection.immutable.Stream$$.newBuilder(Stream.scala:418)
at scala.collection.generic.GenericTraversableTemplate$$class.genericBuilder(GenericTraversableTemplate.scala:34)
at scala.collection.immutable.Stream.genericBuilder(Stream.scala:41)
at scala.collection.generic.TraversableFactory$$GenericCanBuildFrom.apply(TraversableFactory.scala:22)
at scala.collection.generic.TraversableFactory$$GenericCanBuildFrom.apply(TraversableFactory.scala:21)
at scala.Tuple2$$Zipped.map(Tuple2.scala:54)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:489)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:483)
at scala.collection.LinearSeqLike$$$$anon$$1.next(LinearSeqLike.scala:72)
at scala.Tuple2$$Zipped$$$$anonfun$$map$$1.apply(Tuple2.scala:59)
at scala.collection.immutable.Stream.foreach(Stream.scala:191)
at scala.Tuple2$$Zipped.map(Tuple2.scala:57)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:489)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:483)
at scala.collection.LinearSeqLike$$$$anon$$1.next(LinearSeqLike.scala:72)
at scala.Tuple2$$Zipped$$$$anonfun$$map$$1.apply(Tuple2.scala:59)
at scala.collection.immutable.Stream.foreach(Stream.scala:191)
at scala.Tuple2$$Zipped.map(Tuple2.scala:57)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:489)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:483)
at scala.collection.LinearSeqLike$$$$anon$$1.next(LinearSeqLike.scala:72)
at scala.Tuple2$$Zipped$$$$anonfun$$map$$1.apply(Tuple2.scala:59)
at scala.collection.immutable.Stream.foreach(Stream.scala:191)
at scala.Tuple2$$Zipped.map(Tuple2.scala:57)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at $$anonfun$$1$$$$anonfun$$apply$$1.apply(<console>:4)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:489)
at scala.collection.immutable.Stream$$Cons.tail(Stream.scala:483)
at scala.collection.LinearSeqLike$$$$anon$$1.next(Linea...
The text was updated successfully, but these errors were encountered:
@adriaanm said:
Sorry, we'll have to spec zipped as returning a strict collection, because the lazy variant is too complicated to implement with the current interface for Builder. Or are we missing something? Will be a wontfix as soon as I get a chance to update the documentation to reflect this.
The text was updated successfully, but these errors were encountered: