class Array # Returns the positive ordinal index given # a cardinal position, 1 to n or -n to -1. # # require 'facet/array/pos' # # [1,2,3,4,5].pos(1) #=> 0 # [1,2,3,4,5].pos(-1) #=> 4 # def pos(i) if i > 0 return i - 1 else self.length + i end end end