From: Serabe Date: 2008-09-10T09:17:42+09:00 Subject: Re: yield/block question What about this? class Array def each_leaf(&block) each do |x| case x when Array: x.each_leaf &block else block.call x end end end end arr = [[1,2], 3, [[4]]] result = 0 arr.each_leaf{|n| result += n} puts result Kind regards, Serabe P.D. Sorry for no more explanation, but I'm really tired (2:23 am right now). -- http://www.serabe.com