WKC CCC wrote:
> I've found that using:
> 
> copy = one.map { |el| el.clone }
> 
> will copy all elements into the new array without referring to the same 
> object.
> Is there a reason why the clone function has been ommitted from the API 
> doc?

It seems much simpler to just clone the array rather than each element 
individually:

irb(main):001:0> a=[]
=> []
irb(main):002:0> 10.times{|i| a << i}
=> 10
irb(main):003:0> a
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
irb(main):004:0> b = a.clone
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
irb(main):005:0> a[0] = 10
=> 10
irb(main):006:0> a
=> [10, 1, 2, 3, 4, 5, 6, 7, 8, 9]
irb(main):007:0> b
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

-- 
Posted via http://www.ruby-forum.com/.