From: Ammar Ali Date: 2010-10-30T03:01:52+09:00 Subject: Re: operator bug (or not)? On Fri, Oct 29, 2010 at 7:29 PM, Robert Pankowecki wrote: > What's your point ? > > I know that [*a] == a when a.is_?(Array). It's logical. > > What I am saying is that in my opinion it should be a different array > instance with same elements. > > a = [1] > b = [1] > > a == b => true > but > a.object_id == b.object_id => false. > > When you see such code: > [*a] > do you think a new array will be created ? > > Because I do. > > So I expect that for Array > [*a].object_id == a.object_id => false > > Unless there is something that I am missing. From Read Ruby: When given an object that does not respond to :to_a, Kernel.Array() returns an Array with that object as its sole element. Therefore, splatting such an object causes it to expand to itself, effectively a no‐op. Here' the link to the splat coverage: http://ruby.runpaint.org/variables#splat HTH, Ammar