Skip to content
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

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

fingolfin
Copy link
Member

... by high-level synonyms, which are easier to understand, and also
stable under changes to the GAP kernel.

... by high-level synonyms, which are easier to understand, and also
stable under changes to the GAP kernel.
@codecov
Copy link

codecov bot commented Feb 9, 2022

Codecov Report

Merging #782 (b465884) into master (09dd8aa) will not change coverage.
The diff coverage is 88.88%.

@@           Coverage Diff           @@
##           master     #782   +/-   ##
=======================================
  Coverage   78.19%   78.19%           
=======================================
  Files          46       46           
  Lines        3642     3642           
=======================================
  Hits         2848     2848           
  Misses        794      794           
Impacted Files Coverage Δ
src/adapter.jl 67.90% <80.00%> (ø)
src/wrappers.jl 100.00% <100.00%> (ø)

Comment on lines +43 to +46
| `zero` | `ZeroSameMutability` |
| `one` | `OneSameMutability` |
| `-` (unary) | `AdditiveInverseSameMutability` |
| `inv` | `InverseSameMutability` |
Copy link
Member Author

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:

Suggested change
| `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...

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@ThomasBreuer ThomasBreuer merged commit 84ddaee into oscar-system:master Feb 10, 2022
@fingolfin fingolfin deleted the mh/SameMutability branch February 10, 2022 23:31
ThomasBreuer added a commit to ThomasBreuer/GAP.jl that referenced this pull request Feb 14, 2022
on the GAP side for the unary Julia operations `zero`, `one`, `-`, `inv`

(This question came up in the discussion of oscar-system#782.)
fingolfin pushed a commit that referenced this pull request Feb 14, 2022
on the GAP side for the unary Julia operations `zero`, `one`, `-`, `inv`

(This question came up in the discussion of #782.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants