From: Austin Ziegler Date: 2003-11-20T05:36:15+09:00 Subject: Re: Multi-dimensioned sparse array ? On Thu, 20 Nov 2003 02:42:16 +0900, Robert Klemme wrote: > "Austin Ziegler" schrieb im Newsbeitrag >> On Wed, 19 Nov 2003 14:21:19 +0900, Charles Hixson wrote: >>> Does anyone have an implementation of a multi-dimensioned sparse >>> array? >> What about using hashes? [...] >> msa = Hash.new { |h, k| h[k] = Hash.new } >> hash_maker = proc { |h, k| h[k] = Hash.new(&hash_maker) } >> msa = Hash.new(&hash_maker) > Another option: use a single Hash, *no* hash nesting and arrays as > keys: I believe that Mr Hixson requires slices. This wouldn't be possible with array-keys. -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.11.19 * 15.34.36