-
Notifications
You must be signed in to change notification settings - Fork 22
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
Replace some calls to low-level GAP functions #782
Conversation
... by high-level synonyms, which are easier to understand, and also stable under changes to the GAP kernel.
Codecov Report
@@ Coverage Diff @@
## master #782 +/- ##
=======================================
Coverage 78.19% 78.19%
=======================================
Files 46 46
Lines 3642 3642
=======================================
Hits 2848 2848
Misses 794 794
|
| `zero` | `ZeroSameMutability` | | ||
| `one` | `OneSameMutability` | | ||
| `-` (unary) | `AdditiveInverseSameMutability` | | ||
| `inv` | `InverseSameMutability` | |
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.
... but perhaps we should instead switch the mapping:
| `zero` | `ZeroSameMutability` | | |
| `one` | `OneSameMutability` | | |
| `-` (unary) | `AdditiveInverseSameMutability` | | |
| `inv` | `InverseSameMutability` | | |
| `zero` | `Zero` | | |
| `one` | `One` | | |
| `-` (unary) | `AdditiveInverse` | | |
| `inv` | `Inverse` | |
As that probably avoids further pain points. I am not sure if there is any good reason for mapping to the "same mutability" variants? Maybe @ThomasBreuer can think of any?
If we do such a switch, then I'd consider it a breaking change (i.e. for GAP.jl 0.8) as it at least in principle could break some existing code...
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.
(I had yesterday tried to add a comment here, but now I do not find it anymore. Strange. Anyhow, here it is again.)
In GAP, binary arithmetic operations return immutable results if and only if the two arguments are immutable.
Thus it is consistent if unary arithmetic operations return a result with the same mutability as the argument.
Of course, GAP has several variants of these unary operations, regarding the mutability of the result, but here we have to choose one behaviour.
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.
OK, fair enough.
So, shall we merge this as-is?
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.
Yes.
on the GAP side for the unary Julia operations `zero`, `one`, `-`, `inv` (This question came up in the discussion of oscar-system#782.)
on the GAP side for the unary Julia operations `zero`, `one`, `-`, `inv` (This question came up in the discussion of #782.)
... by high-level synonyms, which are easier to understand, and also
stable under changes to the GAP kernel.