how do I instantiate an iterator in kotlin? every ...
# getting-started
h
how do I instantiate an iterator in kotlin? every iterator is an interface
a
That sounds like an XY Problem. What are you trying to achieve?
h
draw a line between every point in a list of points
n
that sounds like you always want to process one point with the next
h
so from it to it.next() presumbaly. i could do like...
for (point in 0 until points.size -1)
?
and just use
points[point]
and
points[point+1]
but i figured kotlin has a more elegant solution
n
^ that.. i knew there was a thing for this, in other cases maybe fold would have been useful too
a
h
looks like it was deleted? because
CharSequence
?
ah
beautiful, thank you
a
yep, at first i posted the wrong one of
CharSequence