Jason Gloudon
# 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.

Okay.  If the array is dim()ed, can we then have the calculations done
(or at least set up) at compile time, and non-dim()ed MD arrays are
arrays of arrays?

        #P1, P2 are the indexes of a 10x10 MD array
        mult P3, P1, 10
        incr P3, P2
        fetchlex P4, "@ary"
        fetchary P5, P4, P3
        #do whatever

--Brent Dax
[EMAIL PROTECTED]
Configure pumpking for Perl 6

When I take action, I'm not going to fire a $2 million missile at a $10
empty tent and hit a camel in the butt.
    --Dubya

Reply via email to