Skip to content

Conversation

@markuspf
Copy link
Member

This is a result of trying to fix a bug in DeclareAttribute, namely if a user did the following

gap> DeclareAttribute("PlaceHolder", IsGroup);
gap> DeclareAttribute("PlaceHolder", IsMultiplicativeElement);

Then the second instance of PlaceHolder would not be stored in the global array ATTRIBUTES.

In the process this PR also fixes a bug with argument parsing in DeclareAttribute and NewAttribute, where if one gave "mutable" as third argument, the argument for rank would be ignored.

We now allow passing true or false as well as the string "mutable" as mutability flag.

This is the result of trying to fix a bug in DeclareAttribute where
if the user called it with the same name but different filters,
the attributes would be setup correctly, but the second would not be
added to the list ATTRIBUTES.

The argument parsing made it impossible to give "mutable" and a rank
for the attribute: If one gave "mutable", the rank would be ignored.
If a user called `DeclareAttribute` more than once with the same attribute
name, but with different filters:

```
gap> DeclareAttribute("PlaceHolder", IsGroup);
gap> DeclareAttribute("PlaceHolder", IsMultiplicativeElement);
```

the attributes would be created correctly, but the second instance was
not registered in the global list ATTRIBUTES. This commit fixes this.
@markuspf
Copy link
Member Author

Currently there is neither updated documentation nor are there tests.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

This PR modifies lib/oper.g but does not sync the changes with hpcgap/lib/oper.g, which needs to be done before merging it (but of course it can be postponed until the rest of the PR has been reviewed positively)

@markuspf
Copy link
Member Author

I discovered that, to fix this issue properly, I will have to do more things, so I will submit smaller PRs that do the refactoring and the fixes I believe are correct separately.

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