Well, a text filter remains the only way to change Perl 5's syntax -- but Perl 6 allows direct parser access, so we've been waiting lo these eight years or so to see what happens there. There was also a discussion some time ago about making Perl 6 syntax more array- friendly. Larry didn't like our "(n)"-vs-"n" syntax for cutting out a dimension in slices, and promised to think of something better -- but I don't think he ever did.


On May 29, 2011, at 2:02 AM, Daniel Carrera wrote:

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



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to