On 29 May 2011 07:38, Karl Glazebrook <[email protected]> wrote:
>
> My main irritation with NiceSlice is it does not work in the debugger.
>
> Anyone know a solution to that?
I have an idea that is probably stupid and impractical, but I'll post
anyway and maybe someone can turn it into a good idea:
"Piddles" could be implemented as function references. A quick demo:
use PDL;
{
# This is a closure.
my $piddle = pdl [1,2,3,4,5];
$a = sub {
my $slice = shift;
$piddle->slice($slice);
}
}
print &$a("2:4") . "\n" ;
So, instead of writing $a(2:4) as in NiceSlice, you'd write
&$a("2:4"). This is a little more verbose, but requires no text
processing. The other drawback is that I have no idea how you'd
implement all the other piddle operations, but maybe someone who knows
something about Perl OOP knows.
Daniel.
--
I'm not overweight, I'm undertall.
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl