From: Justin To Date: 2008-06-11T04:04:14+09:00 Subject: Re: Basic Tree Data Structure Thanks Dustin, that clarifies one bit of the confusion, but I'm still puzzled: Output: Parent in child node 3 Parent Output: Child 1 in child node 3 Child 1 3 Parent # Q1: Why does it go through the Parent again? Output: Grandchild 1.1 class Tree def each puts "1" yield value # Q2: Which block does this invoke? puts "2" @children.each do |child_node| puts "in child_node" child_node.each { |e| puts "3"; yield e; } # Q3: Which block does this # yield invoke? end end end t.each { |x| puts "t.each"; puts x } I'm trying hard to understand!! =D Thanks for the help! -- Posted via http://www.ruby-forum.com/.