Hi,

I'd like to use multi-arrays, but I can't understand how they're 
working. I looked at $PARROT/t/pmc/multiarray.t, but it's a bit 
obscure.
Could you help me to understand them please? Or are they deprecated? 
Should I use something else to have arrays of arrays? What are the 
limitations of multiarrays? I've read in classes/multiarray.pmc that 
multiarrays can only grow in their _last_ direction: is there a 
multidimensionnal pmc that can grow on whatever the dimesion?

About multiarray, I tried the following, and it works, but please help 
me to understand what I wrote:

        new P2, .Key
        set P2, 10
        new P3, .Key
        set P3, 5
        push P2, P3
# Ok, I can understand that I'm building its width and height with 
# P2 and P3, and concatenate all the keys in one "multidimensinal" 
# key.
        new P1, .PerlArray
# I understand that building a multiarray requires parameters, 
# that we provide in a list (does multiarray require a PerlArray, 
# or may I use something else?)
        set P1[0], 0        # what does this param means?
        set P1[1], 200      # what does this param means?
        set P1[2], 1        # what does this param means?
        set P1[3], P2       # The dimensions of the multiarray?
        new P0, .MultiArray, P1

        set P0[2;3], "foobar"
        set S10, P0[10;10]
        print S10
        print "\n"
        end

How can I make the multiarray grow? Is it self expandable, like the 
PerlArray (that is, accessing an element out of bounds make the 
PerlArray grow to fit till that new bound)?

Jerome, who'd like to understand...
-- 
[EMAIL PROTECTED]

Reply via email to