From: Daniel Lucraft Date: 2007-08-02T19:49:42+09:00 Subject: Re: Deep YAML Daniel Lucraft wrote: > # first build the tree: > deeptree = [] > curr = deeptree > refs = [] > 5000.times do |i| > n = [i, []] > curr << n > curr = n[1] > refs << n > end Oops, that actually makes a tree that looks like this: [[0, [[1, [[2, [[3, [[4, []]]]]]]]]]] I meant this: refs = [] deeptree = [] curr = deeptree 5000.times do |i| n = [] curr << i curr << n curr = n refs << n end which does look like this: [0, [1, [2, [3, [4, []]]]]] soz, Dan -- Posted via http://www.ruby-forum.com/.