From: Infinit Blue Date: 2008-04-09T01:21:02+09:00 Subject: Re: How to modify the param value in block > > brian@airstream:~$ irb > irb(main):001:0> def test > irb(main):002:1> n = 1 > irb(main):003:1> n = yield(n) > irb(main):004:1> puts n > irb(main):005:1> end > => nil > irb(main):006:0> test {|x| x += 1; puts x; x } > 2 > 2 > => nil how can I force x pass by ref ? then I can change the value of x in the block and no need to hv a return value and assign statement. -- Posted via http://www.ruby-forum.com/.