From: Mat Schaffer Date: 2006-05-26T23:57:03+09:00 Subject: Re: Questionable behavior On May 26, 2006, at 9:54 AM, transfire@gmail.com wrote: > I'm getting some very strange behavior from a conditional statement -- > I can;t imagine how it is happeneing and I wondering if I stumbled > upon > some sort of bug in Ruby. Although I have no idea how it could even > occuer, perhaps someone else can see it. Here's the code: > > p pkg > p pkg.gem > p pkg.gem > if pkg.gem > p "HERE" > pkg = pkg.__merge__( pkg.gem ) > end > p pkg > > This prints > > # > nil > nil > nil > > Notice it does not print "HERE" yet by that last print pkg has somehow > become nil! Note that I repeated 'p pkg.gem' to show that it has > nothing to do with calling this statment. Now if I remark out the pkg > assignment: > > p pkg > p pkg.gem > p pkg.gem > if pkg.gem > p "HERE" > #pkg = pkg.__merge__( pkg.gem ) > end > p pkg > > I get > > # > nil > nil > # > > As it should be. How is this possible? I'd be happy to test it here and see if I can replicate it. But I don't know what an OpenObject is. -Mat