On Sun, Nov 11, 2001 at 08:57:15PM -0800, Brent Dax wrote:

> You get the idea?  And as for multidimensional stuff, what's wrong with:
> 
>       fetchlex P1, "@lol"
>       fetchary P2, P1, 1
>       fetchary P3, P2, 2
>       #...

Consider (from exegesis 2):

my int @hit_count is dim(100,366,24);

This array is supposed to contain bare integer values as opposed to scalars in
order to be memory efficient. It has been said that there would be a single PMC
which references the appropriate block or blocks of memory.

Also, any array access, for example @hitcount[5][5][6]

has to be done using the vtable of @hitcount as there is no scalar for each
entry. Hence the variable number of keys.

> Yes, I know, some people don't like that multidimensional arrays are
> internally arrays of arrays, but that doesn't necessarily need to be
> obvious to the outside world, does it?  Internally, the nested arrays
> could have tweaked vtables to do whatever they ought to do.

You potentially make all multidimensional arrays slower this way, if you HAVE
to do a memory lookup for each dimension to find an entry, as opposed to
directly calculating its offset in a contiguous block of memory.

-- 
Jason

Reply via email to