Jeremy Howard wrote:
> > > > @foo = @bar x 3;
> > > > @foo = @bar * 4;
> > > > @LoL = @foo * @bar;
> > > > @baz =~ s/here/there/;
> Exactly. Currently PDL provides a lot of the numeric side of this, but
> wouldn't it be nice if perl 6 had the hooks in place to allow PDL to
> integrate even closer into the language... and under the "many people expect
> it to work this way, so it does" philosophy, why shouldn't the same syntax
> work for list/array/tensor data types other than pdl's?
>
> I've cross-posted this to the PDL porters list--what do you guys think?
Sure. We currently overload 'x' with matmult, '*' with normal mult. If
perl 6 will do matmult then it should 'feel' similar to matmult of PDLs.
perl 6 being largely vapourware at this stage it seems more important
that the design will allow for simple parser/flexer changes to
acommodate such things as they are fleshed out. Similarly, the OO
aspects should be designed in a way that make life easy for many classes
(among them PDL). Exact definition of overloading semantics and
capabilities should be part of the core OO design.
On the wishlist we would love something (not sure about nice syntax)
that allowed us to write the crucial indexing of piddles in a nicer
(read shorter) way, maybe even overload the parsing behaviour of the
argument, e.g.
$pdl(1:4,$n+1);
instead of currently
$pdl->slice("1:4,${\($n+1)}");
# or equivalently
$pdl->mslice("1:4",$n+1);
Christian
PS: and we must keep the new 'lvalue subs' since they make life so much
easier.