From: botp Date: 2010-10-30T12:30:45+09:00 Subject: Re: operator bug (or not)? On Sat, Oct 30, 2010 at 1:29 AM, Robert Pankowecki wrote: > What's your point ? > I know that [*a] == a when a.is_?(Array). It's logical. of course LOL. forgot to affix the object_id.. i should have pasted your code but was getting lazy that night... so.. > a=[] => [] >> (b=[*a]).object_id == (b=*a).object_id => true wc means, the [ ] is ignored >> (b=*a).object_id == (b=a).object_id => true so is * >> (b=[*a]).object_id == (b=a).object_id => true so is [* ] > When you see such code: > [*a] >do you think a new array will be created ? >Because I do. the confusion is understandable. suffice it to say that the splat cannot override literals or hell breaks loose :) >> (b=[*[]]).object_id == (b=*[]).object_id => false and splat does not even have a corresponding alias or method :) lesson is: do not compare splatted objects.. it's undocumented and very confusing :)) best regards -botp