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
Strange behaviour of <<!=>> #4838
Comments
The problem appears to be in the codegen of my @a = 0, 0, 0;
say METAOP_HYPER(&infix:<<!=>>)(@a,@a); # [False False False] This seems to be caused by the decision at https://github.com/rakudo/rakudo/blob/master/src/Perl6/Actions.nqp#L8121 to go for the given AST, rather than generating the proper call to Making that code always generate the call to |
In response to #4838 The applied fix feels hacky, but != *is* the only op that is actually implemented as an op, and not as meta-handling applied to an op. Suggestions for better fix welcome!
In response to #4838 The applied fix feels hacky, but != *is* the only op that is actually implemented as an op, and not as meta-handling applied to an op. Suggestions for better fix welcome!
Turns out it was all wrong to begin with: my @a = 1,2,3;
my @b = 4,5,6;
say @a >>!=<< @b;
say @a; # [False False False]
say @b; # [4 5 6] So it actually created a meta-op using assignment. As can be seen with: say (1,2) >>!=<< (3,4);
# Cannot modify an immutable Int (1) @jnthn++ for noting. Fixed for now with the PR, should have special attention in the RakuAST branch in the future. |
The Problem
From https://stackoverflow.com/questions/71690554/strange-behavior-of-a-hyperoperator
Expected Behavior
Actual Behavior
This is on Rakudo HEAD.
The text was updated successfully, but these errors were encountered: