No, I understand how things work. I ran into a bug. In reporting the bug, I 
simplified the problem down to a reduced testcase. I understand completely that 
the testcase makes no sense, and no one in their right mind would write code 
like that.

 

I simplified the code even more. This code works (no error):

 

#!/usr/bin/perl

use PDL;

#use PDL::NiceSlice;

my $s = sub { 1; };

$s->(3);

 

But when you uncomment the use PDL::NiceSlice line, the program reports an 
error when you run it.

 

Again, I can post the original code if you’d like.

 

Steve

 

 

From: Kåre Edvardsen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 29, 2007 10:00 AM
To: Jarle Brinchmann
Cc: Steve Chapel; [email protected]
Subject: Re: [Perldl] Can't call method "nslice" on unblessed reference

 

Hi Steve,

also 

my $x = sum($a->slice("0:0,1"));

seem a little odd as you here try to sum from 0 to 0 on the second row...?
I guess this code has no intention other than you try to figure out how things 
work?

Cheers,
Kare

On Thu, 2007-11-29 at 14:46 +0000, Jarle Brinchmann wrote: 

 
Hi Steve
 
> my $s = sub { 1; };
> my $x = sum($a->slice("0:0,1"));
> $s->($x);
 
It isn't clear to me what you intend to do here - $s is reference to a 
subroutine so -> cannot act on this (which is why you get the error). 
What is the intention with the code?
 
                               Cheers,
                                      Jarle.
 
 
_______________________________________________
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