> Karl Glazebrook wrote:
> > There is a difference between a List of Lists and a multi-dimensional
> array - the
> > latter is rectangular, e.g. the rows are all the same size so you don't
> have to
> > store the sizes of individual ones. So the latter needs much less storage
> overhead.
> > How would you be proposed this be handled transparently? esp. if calling
> external
> > C routines.
> >
> This is only a difference in how P5 implements LOLs vs how PDL implements
> n-dim arrays. P6 need not have this difference. A LOL of a simple type,
> perhaps with the addition of an attribute (':compact'?) would be stored as
> an n-dim array. Non-uniform sized rows would be padded. The dimensions of
> the LOL would be stored somewhere just like with a PDL array.

I think that once you have LOL's automagically padded to size, and that 
size stored as an intrinsic part of the LOL, you no longer have a 
traditional LOL.  You have something that looks, walks, and quacks like 
a matrix and doesn't walk or quack like an LOL.  Why not call it a 
matrix?

I -like- the idea of array refs being used as indices into matrices.  
It's a natural extension to the existing array notation.  I -don't- 
like the idea of LOL notation for matrix access -- especially if you 
don't plan on actually implementing matrices as LOLs.  If LOLs were 
sufficient for matrix implimentation, PDL would not have done what they 
did.

> > Reduce functionality equivalent is already available in PDL modules, so I
> don't
> > see that as terribly urgent.
> >
> RFC 76 proposes a reduce() builtin that is quite flexible. If we have
> something better we should propose that instead, or get Damian to
> incorporate the additional ideas into the existing RFC. I think it would be
> unfortunate if RFC 76 turned out to be incompatible with the n-dim array
> notation we come up with.

Which is more important, the fundamentals of n-dim array operation, or 
reduce on n-dim arrays?  If the former, optimise n-dim arrays for the 
fundamentals, which may not lead to LOL as the solution.  If the 
latter, then LOL's may be the way to go.  Or maybe not...

@xsums[^i;^j] = reduce sum 0,@cube[..;^i;^j];
@ysums[^i;^j] = reduce sum 0,@cube[^i;..;^j];
@zsums[^i;^j] = reduce sum 0,@cube[^i;^j;..];

How would that go in LOL notation?

-- 
     Buddha Buck                             [EMAIL PROTECTED]
"Just as the strength of the Internet is chaos, so the strength of our
liberty depends upon the chaos and cacophony of the unfettered speech
the First Amendment protects."  -- A.L.A. v. U.S. Dept. of Justice


Reply via email to