From: Louis J Scoras Date: 2006-11-17T00:46:08+09:00 Subject: Re: #returning and #tap I think where returning really makes a difference is with local variables. If you have some code where you want to initialize a local variable in a block and then use it afterward your up the creek. def foo(a) a.each do |x| (b ||= []) << x end b # => oops end a = [1,2,3] p foo(a) What you need to do, of course, is just initialize before the block: def foo(a) b = [] a.each do |x| b << x end b end Ugly. Sorry, it just is. It is much more readable to use returning. def foo(a) returning [] do |b| a.each do |x| b << x end end end On another note, I don't buy the argument that this is a bad practice because the you no longer look for the last value to see what is returned. That's exactly what you do. The last element in this function is the 'end' of the returning block. What does returning return? I think its pretty obvious personally. -- Lou.