I’m doing the following:
indices = 1.upto(points.size)
zipped = indices.zip(distances, points)
Basically, I’m temporarily annotating my point objects with an index
to avoid losing track of its original position.
indices is just a list going from 1 to points.size.
This works find with ruby 1.8.7, but not for ruby 1.8.6, where upto()
requires a block.
What’s the most rubyesque way of doing the same thing in 1.8.6?