-
Notifications
You must be signed in to change notification settings - Fork 576
Implement assigning xor (^^=) operator #23242
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
Conversation
Probably need to update the |
Thoughts from PTS is that we'd like to merge this soon, so it can be tested and included in 5.41.13 - if anyone wants to review? |
Does the fact that you refer to a development release '5.41.13' mean that we are no longer aiming to issue a production release '5.42.0' on May 20? If so, I think a revision of the release schedule should be discussed on the Perl 5 Porters list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment operators are supposed to return their LHS as an lvalue:
$ ./perl -Ilib -wE 'my $x; my $y = 1; ($x ||= $y) = 42; say $x'
42
But:
$ ./perl -Ilib -wE 'my $x; my $y = 1; ($x ^^= $y) = 42; say $x'
Can't modify logical xor in list assignment at -e line 1, near "42;"
Execution of -e aborted due to compilation errors.
When I added '^^' I forgot to implement or test the assigning version of it. Also it seems `pp_xor` had the left and right arguments round the wrong way; but until the asymmetry introduced by this change nobody had noticed before. This is now fixed. Also adds `B::Deparse` support for the new assigning xor operator
Ahyes. Lvalue context now fixed:
|
When I added '^^' I forgot to implement or test the assigning version of it.
Also it seems
pp_xor
had the left and right arguments round the wrong way; but until the asymmetry introduced by this change nobody had noticed before. This is now fixed.(I should write the perldelta)
(fixes #23238)