From: Robert Klemme Date: 2011-01-11T01:04:54+09:00 Subject: Re: Nooby question : multidimensional arrays. On Mon, Jan 10, 2011 at 4:14 PM, Kedar Mhaswade wrote: >> If you need that you could do something like >> https://gist.github.com/772827 > Interesting. Thanks, Robert. > But using hash internally to represent arrays is slightly > counterintuitive. Well, you don't see it from the outside. For users of the class it doesn't really matter how it internally works (unless they hit some limitations). > But I agree, it will work well for "sparse" > multi-dimensional arrays. Exactly that was the use case I had in mind. > I realize that I could do something similar > and still retain the one-dimensional flattening, in my implementation. How exactly do you want to do that? > And yes, expanding it to do non-cube entities is on my list. :-) Actually "cube" is just a special case of the more general one. I'd rather implement the special case and add a custom constructor for the cube case: https://gist.github.com/772827 Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/