What is the idiomatic Ruby way to go through all the elements of an array,
except the last one, gettting the index?
my_array.each_index {
|i|
unless i == my_array.last {
# ...
}
}
seems less than neat.
Reason I want to do this -- If one is producing a difference table from an
array such that:
d[i] = a[i+1] - a[i]
one doesn't want to fall off the end...
Hugh