New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
which() warning about operator precedence #213
Comments
The only way outside of disabling the warning is to add extra parentheses so that Perl knows that you meant to write the code that way: which( ( $a < 1 ) | ( $a > 3 ) ); |
Am I missing something? I see that warning as a good thing, and indeed that one should use parens. If one wants to suppress it, |
Thanks @zmughal, @mohawk2 ! I am new to PDL, and I've not been using bitwise operator in Perl for long that the parentheses thing did not come to my mind. And you know R's which() method does not require parens in this case. I think this ticket can be closed now, but I wonder if it could be better to add an example to which() in PDL::Primitive, so that people like me can just figure it out. |
@stphnlyd You're probably right about the example. PRs welcome :-) I'll close this issue. |
For example, below code gives warning
Possible precedence problem on bitwise | operator
I know I can suppress it by
no warnings 'precedence';
, but is there any better ways?The text was updated successfully, but these errors were encountered: