Yukihiro Matsumoto wrote:
> |since ruby's array doesn't have index(POS, OBJ) like in python, nor 
> |splice() like in perl, what is the most common way to insert an element 
> |at a specified position?
> 
> ary = [0,1,2]
> ary[1,0] = "a"  # => ary = [0,"a",1,2]

hm, that's the ugliest thing i've seen in ruby so far. :-)

since ruby already has a rich set of methods for Array, including 
convenience/"secondary" stuffs like flatten(), indexes(), or rassoc(), 
wouldn't it make some sense to add insert() too? just a suggestion. (i 
could add the method myself, of course, but...)

-- 
dave