Seems like it ought to work but, again as before, I'm not sure enough of the implementation to determine if it should work or not. Maybe when Craig finishes his tutorial/explanation of how threading/slicing works...
If adding to PDL::Lvalue works, then there is no value in using the alternatives. --Chris On Thu, Sep 25, 2014 at 4:23 PM, Luis Mochan <[email protected]> wrote: > I found a similar issue with 'rotate'. I would like to be able to say > $a->rotate($n).=$b; > Would it be safe to add rotate to @funcs in PDL::Lvalue.pm? > > It seems that > ($tmp=$a->rotate($n)).=$b > works, as well as > $a->rotate($n)->(0:-1).=$b > Are these alternative better/safer? > > Best regards, > Luis > > > On Wed, Mar 26, 2014 at 08:47:51AM +0800, vine xf wrote: >> Oh great! After append 'reorder' to PDL::Lvalue.pm, it works as lvalue >> function now. Thanks! >> >> On Wed, Mar 26, 2014 at 7:44 AM, Chris Marshall >> <[email protected]>wrote: >> >> > reorder() is not listed as an Lvalue subroutine. >> > See PDL::Lvalue for the list. It seems like it >> > should be but I'm not sure enough of the implementation >> > to determine if it will work as one. You could try >> > adding it to the PDL::Lvalue list and see if it works. >> > >> > --Chris >> > >> > >> > On Tue, Mar 25, 2014 at 7:24 PM, vine xf <[email protected]> wrote: >> > > Hi, >> > > >> > > I got an error message while using PDL(2.007, ActivePerl5.16), but don't >> > > know >> > > why. Here's a simplified example: >> > > >> > > everything's ok for this code: >> > > use PDL; >> > > $a = sequence(5,6); >> > > $b = $a->reorder(1,0); >> > > $b .=0; # $a is all zeros now. >> > > >> > > but this code doesn't work: >> > > use PDL; >> > > $a = sequence(5,6); >> > > $a->reorder(1,0) .= 0; #Can't modify non-lvalue subroutine call at - >> > line 3, >> > > ... >> > > >> > > But methods like ->splice(...) could be assigned to without any problem. >> > Is >> > > there a subset of PDL method which can't be assigned to just like >> > reorder()? >> > > >> > > Xiaofang. >> > > >> > > >> > > _______________________________________________ >> > > Perldl mailing list >> > > [email protected] >> > > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl >> > > >> > > >> _______________________________________________ >> Perldl mailing list >> [email protected] >> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > > > -- > > o > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Apdo. Postal 48-3, 62251 | (*)/\/ \ > Cuernavaca, Morelos, México | [email protected] /\_/\__/ > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB > > > > _______________________________________________ > Perldl mailing list > [email protected] > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
