https://kotlinlang.org logo
Title
l

lupajz

10/05/2017, 3:09 PM
While we are at sequences what are differences between
buidSequence
&
generateSequence
is it only that the later takes suspendable function ?
k

karelpeeters

10/05/2017, 3:40 PM
`Sequence`s are lazy `Iterator`s mostly. I don't know about the difference, maybe check the code?
l

lupajz

10/05/2017, 3:46 PM
I know they are lazy iterators. But why do we have 2 different ? Why not have just one builder for this ?
k

karelpeeters

10/05/2017, 4:11 PM
Like I said, read the code or maybe the docs even explain the difference?
a

Andreas Sinz

10/05/2017, 8:21 PM
@lupajz generateSequence uses only kotlin stdlib, buildSequenece relies on co-routines and yields values