develooper Front page | perl.perl6.language | Postings from June 2001

Re: Multi-dimensional arrays and relational db data

Thread Previous | Thread Next
From:
Tim Jenness
Date:
June 10, 2001 21:48
Subject:
Re: Multi-dimensional arrays and relational db data
Message ID:
Pine.LNX.4.33.0106101600180.7543-100000@lapaki.jach.hawaii.edu
On Sun, 10 Jun 2001, Sam Tregar wrote:

> On Sun, 10 Jun 2001, Me wrote:
>
> > Agreed. So long as you are talking about Perl 5's arrays.
> >
> > I disagree, if you are talking about 2 dimensional structures.
>
> You appear to have some fundamental misunderstanding about Perl 5.  Perl 5
> does indeed support multidimentional arrays:
>
>    my @matrix = ( [ 1 2 3 ]
>                   [ 4 5 6 ]
>                   [ 7 8 9 ] );
>    print $matrix[1][2];
>
> You could easily use either "tie" or the new "->[]"  overloading in Perl 5
> to access relational databases in Perl 5.  Are you going to make me show
> you an example before you believe me?
>

At the risk of receiving a flame perl5 does not have multi-dimensional
arrays. It has something that will do the job with a massive memory
overhead ands lots of pain when dimensionality is high. If it had true
support for N-dim arrays then PDL would never have been invented. The main
problem PDL has is that Perl does not have a syntax for N-dim slices so it
has to bolt something on the side by specifying a slice as a string. (see
eg PDL::Slices). Numerical applications will get a significant boost if
N-dim arrays with native slicing are possible in perl6.

-- 
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About