On Dec 5, 2005, at 13:50, Roger Browne wrote:

I'm having some trouble accessing elements of multidimensional arrays
from PIR, and I'm not sure if what I want to do is buggy or
unimplemented, or if I'm simply doing it the wrong way.

      $S0 = array[$P0; $P1]  # [1]

Multi-dimensional keys can consist only of int or string parts, or of constants of these types. If you really need a PMC for the key, you have to create a Key PMC yourself.

E.g.

  k1 = new .Key
  k1 = 1
  k2 = new .Key
  k2 = 2
  push k1, k2        # append next key
  elem = array[k1]   # [1:2]

(untested)

But it's probably simpler to just teach your compiler to use integers/strings rather than PMCs.

Regards,
Roger Browne

leo

Reply via email to