CC: | Christian Walde <walde.christian [...] googlemail.com> |
Subject: | Fwd: PDL vs MooX::Types on #pdl |
Date: | Sun, 28 Jul 2013 13:17:59 -0400 |
To: | bug-MooX-Types-MooseLike [...] rt.cpan.org |
From: | Chris Marshall <devel.chm.01 [...] gmail.com> |
The line 214 test fails for PDL objects because the
logical operations are overloaded and the logical
truth or falsity of a multi-element value is not well
defined.
Looking at the code, it appears that the not $instance
test is actually redundant since the not blessed()
check would catch that as well.
--Chris
Show quoted text
---------- Forwarded message ----------
From: Chris Marshall <devel.chm.01@gmail.com>
Date: Sun, Jul 28, 2013 at 1:11 PM
Subject: Re: PDL vs MooX::Types on #pdl
To: Christian Walde <walde.christian@gmail.com>
Cc: pdl-porters <PDL-porters@jach.hawaii.edu>
It looks like the problem is that the logical not operation
is not defined for a multi-element pdl. It looks like a bug
(or problem in the MooX::Types::MooseLike implementation).
Looking at the code, it seems that the problem test is
redundant since not blessed($pdl) would also exit if
$pdl were false (assuming the overload is ignored).
--Chris
On Sun, Jul 28, 2013 at 12:39 PM, Christian Walde
<walde.christian@gmail.com> wrote:
> On Sun, 28 Jul 2013 18:13:37 +0200, Chris Marshall <devel.chm.01@gmail.com>
> wrote:
>
>> Hi Christian-
>>
>> If you have questions about PDL and other modules,
>> it would be most helpful if you could post the problem
>> with an example code that demonstrates the issue.
>>
>> I could find no MooX::Types via http://search.cpan.org
>> and without specific code, no idea what is happening.
>> Please do follow up as some of the work for PDL3
>> is currently aiming to be based on Moo[se] technology.
>>
>> Thanks,
>> Chris
>>
>> http://irclog.perlgeek.de/pdl/2013-07-27
>
>
> The next line i wrote actually is the example. :)
>
> C:\Windows\System32>perl -e "use PDL; my $instance = pdl(1, 2); print 1 if
> not $instance"
> multielement piddle in conditional expression at -e line 1.
>
> C:\Windows\System32>
>
> That breaks tests for truthiness of a thing passed as an argument to
> MooX::Types::MooseLike at this point:
>
> https://metacpan.org/source/MATEU/MooX-Types-MooseLike-0.24/lib/MooX/Types/MooseLike/Base.pm#L214
>
> --
> With regards,
> Christian Walde