From: "Albert L. Wagner" Date: 2002-01-12T00:07:50+09:00 Subject: "each" in iterator: confusion I do not understand why this code runs forever. Is it because the yield is taken to be a second yield in the super class "each"? Is there a way to do such nested iterators? class MyHash < Hash def each(&block) super.each do | k, v | v2 = v * 2 yield( k, v2) end end end h = MyHash.new h['a'] = 1 h['b'] = 2 h['c'] = 3 h.each do | k, v | puts "#{k}==>#{v}" end -- "It requires wisdom to understand wisdom: the music is nothing if the audience is deaf." - Walter Lippman