Why are you adding 'page' as a child of itself?

tree = page
tree.addchild(page2)
tree.addchild(page3)
tree.addchild(page4)
tree.addchild(page5)
tree.addchild(page)

Sam


On 29/09/11 14:10, Giacomo C. wrote:
> Hi There,
>
> I'm working on a tree data structure at the moment and I'm having
> trouble with the recursive print function. It seems that the function
> simply restarts every time it finishes... Even though it is not a
> infinite loop. Hope that you guy's can help me figure out what the
> problem is.
>
> You will find my code in the attachment.
>
> Thanks,
> Giac0m0.
>
> Attachments:
> http://www.ruby-forum.com/attachment/6635/run.rb
>
>