Sorry, this occurred to me just after writing the previous email. You could
have the warning code check the value of a Perl SV associated with a
documented package global. That way, a user could turn off such warnings in
only a small part of their code by using "local"

{
local $PDL::MatrixOps::matmult_warn = 0;
# code in here issues no warning
}
# code out here warns

Getting the current value of a package global is pretty easy in XS. I can
scrounge up some code if you like.

That might also provide a simple way to build a lexical-like warning
framework for PDL...

David
On Jan 30, 2013 5:53 PM, "David Mertens" <[email protected]> wrote:

> There are a couple of places where these sorts of warnings are baked into
> printf statements in the .pd files. The proper solution is to replace all
> of these with a proper warnings system, like a barf that didn't die. The
> quick fix is to hack on the .pd file. I don't think there's a way to stop
> it programatically, unfortunately.
>
> David
> On Jan 30, 2013 4:27 PM, "Chris Marshall" <[email protected]> wrote:
>
>> I'm getting a bunch of
>>
>>   WARNING: matmult does not handle bad values.
>>
>> every time the matmult routine is called which
>> makes it *exceedingly* difficult to view the
>> output with all the text cruft.  The error does
>> not appear to even go to STDOUT so I couldn't
>> redirect it.
>>
>> Anyone know a good way to stop the warnings
>> or is this a candidate Known_problem (a.k.a., bug).
>>
>> Thanks,
>> Chris
>>
>> _______________________________________________
>> 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