Skip to content

Call GroupByGenerators/GroupWithGenerators with a collection? #2703

Closed
@ThomasBreuer

Description

@alex-konovalov had noticed a test failure,
see #1619 (comment).

This failure is a side-effect of the changes from pull request #2522.

The operations GroupByGenerators and GroupWithGenerators are documented
for a list of generators.
However, their methods accept a collection as the first argument,
and call AsList in order to create a list from it if necessary.
With the abovementioned changes, a new function MakeGroupyType was introduced
that assumes the generators to be a list, and this is where the error happens.

Thus the following works in GAP 4.9 but not in the master branch.

GroupByGenerators( Group( (1,2) ) )

I see several possibilities to fix this problem.

  1. Change the method installations for GroupByGenerators and GroupWithGenerators
    such that only a list & collection or an empty list is accepted as the first argument.
    This fits to the documentation,
    the problem is that existing code may be broken that uses the undocumented feature.

  2. Change the method installations for GroupByGenerators and GroupWithGenerators
    such that a non-list collection given as the first argument gets replaced by a list in the beginning.

  3. Proceed like in 1. but add new methods requiring a collection as the first argument and then
    delegating to the methods for lists;
    add comments to these methods that they might become obsolete at some time.

What do others think?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions