develooper Front page | perl.perl6.language.data | Postings from August 2000

Special syntax for 2-d

Thread Next
From:
Baris Sumengen
Date:
August 29, 2000 08:14
Subject:
Special syntax for 2-d
Message ID:
200008290815110505.15C6C6A1@iplab.ece.ucsb.edu
Hello,

On 8/29/00 at 2:31 PM Jeremy Howard wrote:

>The role of this list is to try and create the features necessary to make
>Perl the best language for data crunching around, while keeping it
Perlish.

"Easy things should be easy".

PDL has a great and powerful built-in multidimentional support, which makes
it a better tool than most similar packages. But on the other hand 90%
(maybe more) of the number crunching is done using 2-d matrices. Matlab 4.x
didn't have any idea of multidimentionality (as far as I know) and it was
the most popular tool back than. Sometimes the multidimentional syntax
makes it painful for people who wants to just use 2-d matrices. So I
suggest syntax improvements specific for 2-d (A dual representation where
someone can use either multidimentional syntax for 2-d or the new
simplified syntax). This idea is not restrictive at all and doesn't effect
the current syntax. I think it as a syntax alias. I have to admit that I
didn't write many pdl programs (only couple of them) so maybe somebody else
who wrote programs using 2-d might comment.

For example to create a new 3x4 matrix you should write:
$m = pdl [1, 2, 3],
              [3, 3, 4],
              [2, 4, 5],
              [2, 4, 6];

I find this painful and would prefer:
$m = pdl [1 2 3,
               3 3 4,
               2 4 5,
               2 4 6];


Baris.



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