Re: multidim. containers
[email protected] (John Porter)
| Newsgroups | perl.perl6.language.data,perl.perl6.internals |
|---|---|
| Message-ID | <[email protected]> |
Dan Sugalski wrote: > > > >I'm thinking that a n-dim array could just be a list of lists (of lists of > >lists of...) with the n-dim notation just being syntactic sugar (and perhaps > >helping with optimisation too). > > If you want efficiency, n-dimensional arrays really need to be a concrete > data type all of their own. That way one big block of memory can be > allocated and, if it's a typed array, properly sized. > > That doesn't mean that n-dimensional arrays won't be just sugar over the > standard list-o-list structure to start, but they won't have to stay that way. Yah, I did exactly this in Tie::Multidim... and it is *hairy*. And slow. -- John Porter We're building the house of the future together.