From: Austin Ziegler Date: 2002-12-30T03:09:34+09:00 Subject: Re: yield and recursion On Sun, 29 Dec 2002 20:56:58 +0900, Christoph Schmitz wrote: > Hi all, > > I was just trying to grasp the concept of iterators, and > the first thing I tried was an iterator for a binary tree. > > What I came up with is something like class Node def inorder(&block) @left.inorder(block) unless @left.nil? yield @value unless block.nil? @right.inorder(block) unless @right.nil? end end -- Austin Ziegler, austin@halostatue.ca on 2002.12.29 at 13.08.00