For example I hv the following code:

def test
  n = 1
  yield(n)
  puts n
end

--------
test {|x| x = x + 1; puts x}

the output is:
2
1

How can I modify the parameter x in block?

Appreciate for your help.
-- 
Posted via http://www.ruby-forum.com/.