Closed
Description
for LazyList.fill
, I would expect the same output in both cases here:
scala> LazyList.continually(println("hey!")).apply(4)
hey!
scala> LazyList.fill(5)(println("hey!")).apply(4)
hey!
hey!
hey!
hey!
hey!
and similarly for tabulate
:
scala> import util.chaining._
import util.chaining._
scala> LazyList.from(0).map(_.tap(println)).apply(4)
4
res30: Int = 4
scala> LazyList.tabulate(5)(_.tap(println)).apply(4)
0
1
2
3
4
res32: Int = 4
perhaps there are other methods with this problem?
noticed in @paulp's gist: https://gist.github.com/paulp/fac614c6de23c10644a7af25f4ef96e4
tentatively assigning @NthPortal as this is a continuation of scala/scala#7000
methods to fix:
-
fill
-
tabulate