From: Kevin Ballard Date: 2005-10-23T02:22:00+09:00 Subject: Re: Unit testing an each function Brian Schr�der wrote: > Sorry, I do not see a better syntax. But I have to admit that I have > no idea what would be the result of > > [[(1..3), (5..8)], [(4..7), (2..6)]].each.each.each { |i| puts i } > > (Well if I think long enough, maybe you mean something like > > [[(1..3), (5..8)], [(4..7), (2..6)]].each do | row | > row.each do | range | > range.each do |i| puts i end > end > end > > Which I would prefer about the "new" idiom, but other people may not. Yes, that is what the construct means. Each successive call is one deeper level of enumeration. If you understand what the nested enumeration semantics mean, then it's not hard to read.