On 8/15/2010 12:24 AM, Chan Nguyen wrote:
> Thanks a lot everybody,
> I'm just too new to Ruby, I will read the book and practice more. The
> last code snippet is really interesting. Thanks Caleb Clausen, I will
> never forget it ;)
Just to add... the only instance that I have found where I "need" to do 
this in C++ is if I have multiple values I want to change, otherwise I 
can just return the new value.  Since you can return multiple values 
from a Ruby function, this is a non-issue:
irb(main):001:0> def foo
irb(main):002:1> return :bar, :foo
irb(main):003:1> end
=> nil
irb(main):004:0> a,b=foo
=> [:bar, :foo]
irb(main):005:0> a
=> :bar
irb(main):006:0> b
=> :foo
irb(main):007:0>