Kevin,


> Many of the Array methods are already bang-type methods,
> even though they don't have the bang: clear, delete,
> delete_at, delete_if, fill, pop, push, replace, shift,
> unshift.


I'd like to have bang and non-bang versions of each and every method.
The names should just differ in the !, like collect and collect!


> However, I haven't found any easy way to deep-copy an
> array. If that really doesn't already exist, I'd like to
> see it added:


What about:
---cut---
array = ['zero','one']
copy_of_array = array.clone
modified_array = copy_of_array.collect{|element| 'replaced'}
p array          # -> ["zero", "one"]
p modified_array # -> ["replaced", "replaced"]
---cut---
array = [['zero','one'],['zero','one']]
copy_of_array = array.clone
modified_array = copy_of_array.flatten.collect{|element| 'replaced'}
p array          # -> [["zero", "one"], ["zero", "one"]]
p modified_array # -> ["replaced", "replaced", "replaced", "replaced"]

---cut---


Or did I get you wrong.


Tobi


-- 
Tobias Reif
http://www.pinkjuice.com/myDigitalProfile.xhtml

go_to('www.ruby-lang.org').get(ruby).play.create.have_fun
http://www.pinkjuice.com/ruby/