[Ironruby-core] Problem with Arrays

Jimmy Schementi Jimmy.Schementi at microsoft.com
Wed Dec 16 20:56:05 EST 2009


Opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3314. That's wacky! Doesn't happen if you remove the last or first item ... it's gonna be fun to track that down. =)

> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> bounces at rubyforge.org] On Behalf Of Pascal Normandin
> Sent: Tuesday, December 15, 2009 8:18 PM
> To: ironruby-core at rubyforge.org
> Subject: [Ironruby-core] Problem with Arrays
> 
> 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
> 
> 
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core



More information about the Ironruby-core mailing list