Note that if we instead of gens we passed a group object, we could test here for HasIsAbelian(G) and IsAbelian(G). And in all places calling here that I found, there already was such a group object -- with the exception of a call in IsThisSL2Natural. But there in turn, all (?) callers to IsThisSL2Natural could easily be changed to pass on a group object.
One could even support both variants in this function, by turning gens into a local var, and calling the first argument G, and doing something like if IsGroup(G) then gens := GeneratorsOfGroup(G); else gens:=G; fi; or so
Note that if we instead of
gens
we passed a group object, we could test here forHasIsAbelian(G) and IsAbelian(G)
. And in all places calling here that I found, there already was such a group object -- with the exception of a call inIsThisSL2Natural
. But there in turn, all (?) callers toIsThisSL2Natural
could easily be changed to pass on a group object.One could even support both variants in this function, by turning
gens
into a local var, and calling the first argumentG
, and doing something likeif IsGroup(G) then gens := GeneratorsOfGroup(G); else gens:=G; fi;
or soOriginally posted by @fingolfin in https://github.com/gap-packages/recog/pull/282#r693956976