[Ironruby-core] Problem with Arrays

Pascal Normandin pascal.normandin at convergentware.com
Tue Dec 15 23:17:31 EST 2009


Hello,

I think I have found a problem with the Array delete_if method.

If I do the following when a do the arr2 = Array.new arr I get a nil value

>>> arr = ["asd", "qwe", "zxc"]
=> ["asd", "qwe", "zxc"]
>>> arr.delete_if{|x| x == "qwe"}
=> ["asd", "zxc"]
>>> arr2 = Array.new arr
=> [nil, "asd"]

This is happening in 0.9.2 and in 1.0 RC1


Using Ruby I don't get that. What I expected.
irb(main):008:0> arr = ["asd", "qwe", "zxc"]
=> ["asd", "qwe", "zxc"]
irb(main):009:0> arr.delete_if{|x| x =="qwe"}
=> ["asd", "zxc"]
irb(main):010:0> arr2 = Array.new arr
=> ["asd", "zxc"]

Pascal




More information about the Ironruby-core mailing list