Re: Multidimensional Arrays

2005-12-05 Thread Leopold Toetsch
On Dec 5, 2005, at 18:11, Roger Browne wrote: Maybe multidimensional array access using PMC indexes isn't supposed to be working yet. I see. Yes you are right. You really can rigth now do the 'easy' cases, where a compiler knows or infers the involved types, but a general multi-dim array ac

Re: Multidimensional Arrays

2005-12-05 Thread Roger Browne
> > $S0 = array[$P0; $P1] Leo suggested: > ... If you really need a PMC for the key, you > have to create a Key PMC yourself. > > E.g. > >k1 = new .Key >k1 = 1 That fragment works OK, but if I try to use a PMC instead of a literal integer... k1 = new .Key $P0 = new .Intege

Re: Multidimensional Arrays

2005-12-05 Thread Roger Browne
Leopold Toetsch wrote: > ... it's probably simpler to just teach your compiler to use > integers/strings rather than PMCs. In general, I don't think a HLL has enough information to do this. For example, if you have an Array of Hashes, the HLL doesn't easily know to convert to an integer for the

Re: Multidimensional Arrays

2005-12-05 Thread Leopold Toetsch
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-d

Multidimensional Arrays

2005-12-05 Thread Roger Browne
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. I have no problem accessing a one-dimensional Array with either an integer index, or with a PM