From: Nathan Grant Date: 2006-10-04T01:48:02+09:00 Subject: Re: sparse multi-dimensional arrays > $a[0][0][0] = 0; > $a[100][100][100] = 100; > > print "$a[0][0][0]\n"; > print "$a[100][100][100]\n"; > > The output: > > 0 > 100 I saw this on inquirylabs.com recently [1] hsh = Hash.new(&(p=lambda{|h,k| h[k] = Hash.new(&p)})) hsh[0][0][0] = 0 >> 0 hsh[100][100][100] = 100 >> 100 HTH Nathan [1] http://blog.inquirylabs.com/2006/09/20/ruby-hashes-of-arbitrary-depth/ -- Posted via http://www.ruby-forum.com/.