From: zuerrong Date: 2010-11-12T10:56:46+09:00 Subject: Re: what's an object? Hi Brian, I just tested what you said, the result is opposite, a is changed. irb(main):026:0> def foo(x) irb(main):027:1> puts x.object_id irb(main):028:1> x << "world" irb(main):029:1> puts x irb(main):030:1> puts x.object_id irb(main):031:1> end => nil irb(main):033:0> a="nice" => "nice" irb(main):034:0> a.object_id => 79554920 irb(main):035:0> foo(a) 79554920 niceworld 79554920 => nil irb(main):036:0> a => "niceworld" 2010/11/11 Brian Candler : > > def foo(x) >  x << " world" > end > > a = "hello" > foo(a) > > a is passed by value, so the method call foo(a) can never affect the > value of a -- Kind regards,      Zuer (祖儿)