2010/1/25 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan / gmail.com>

> On Mon, Jan 25, 2010 at 10:28 PM, Gary Wright <gwtmp01 / mac.com> wrote:
> >
> > On Jan 25, 2010, at 2:24 PM, Glen Holcomb wrote:
> >>
> >> I'll play around with your solution.  I have the following:
> >>
> >> data =3D Hash.new { |l, k| l[k] =3D Hash.new { |l, k| l[k] =3D Hash.ne=
w { |l,
> k|
> >> l[k] =3D Hash.new([]) }}}
> >
> > I'm assuming you want 'infinite' depth.  Consider:
> >
> > default =3D lambda { |h,k| h[k] =3D Hash.new(&default) }
> > top =3D Hash.new(&default)
>
> The problem is that he wants the leaves of the hash to be arrays, and
> not hashes.
>
> Jesus.
>
>
Exactly, infinite depth would be nice as it would make a more temporally
portable solution.  The proxy looks to be working great.  I am a bit
confused as to why the << method in the proxy doesn't overwrite a leaf with
a new array though.  I'm not complaining as it works the way I want it to,
I'm just perplexed.

Thanks Jesus.

--=20
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can=92t hear a word you=92re saying."

-Greg Graffin (Bad Religion)