From: Peter Szinek Date: 2007-11-22T16:38:37+09:00 Subject: Re: How to give depth to arrays? Chris Morales wrote: > Hi, > > I'm trying to convert an array like [2,3,3,5,4,4] in > [2,[3,3,[[5],4,4]]], but I really can't figure how to this. > Is there any way to achieve this in Ruby? I don't really get the question... do you want to do this automatically? If yes, how should the mapping look like (i.e. what decides that 3 is 1 level deep, 5 is 4 level deep etc.)? Cheers, Peter ___ http://www.rubyrailways.com http://scrubyt.org