At 05:35 PM 8/31/00 +, David L. Nicol wrote:
>Buddha Buck wrote:
> > > The array
> > > syntax would also be useful in multi-dimensional arrays.
> >
> > That is if multi-dimensional arrays are implemented as lists-of-lists,
> > which they might not be.
>
>Even if they aren't implemented as lol, they may appear as lol to the
>programmer
The language-data group is working on multi-dimensional array syntax.
I would like to have (in multidimensional arrays) the various dimensions be
equally easy to access. Using lol syntax imposes a hierarchy on the
dimensions, which makes equal access hard.
For instance, using the syntax I proposed in RFC169, you can take the $ith
row and $jth column of a 2-dimensional array with:
@row = @matrix[$i;..];
@col = @matrix[..;$j];
This can be naturally extended to greater dimensions, if need be.
How does one do this in LOL syntax?
@row = @{$matrix[$i]}; # this is easy!
for my $r (@matrix) {
push @col,$$row[$j];
} # this is easy?
I suppose one could do:
for (my $k = 0;$k < @matrix; $k++) {
push @row, $matrix[$i][$k];
push @col, $matrix[$k][$j];
}
but even that obscures what you really want to do.
>--
> David Nicol 816.235.1187 [EMAIL PROTECTED]
>"My baby done left me,
>she done went to the drive-in movies with somebody else."