From: chiaro scuro Date: 2006-05-02T07:01:09+09:00 Subject: Re: traversal of a tree + block code ------=_Part_21120_12709227.1146520865718 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline that's block.call(child), no? On 5/1/06, Andrew Gibson wrote: > > Ahhh..found my solution: > > def self.depthFirstTraversal(parent , &block) > children =3D parent.children > children.each do |child| > block[child] > self.depthFirstTraversal(child, &block) > end > end > > I'm not familiar with the [] for passing the argument to the proc(?) ... > anyone have any comments? > > -- > Posted via http://www.ruby-forum.com/. > > -- Chiaroscuro --- Liquid Development: http://liquiddevelopment.blogspot.com/ ------=_Part_21120_12709227.1146520865718--