diff --git a/gap/structure.gi b/gap/structure.gi index f458838..836e504 100644 --- a/gap/structure.gi +++ b/gap/structure.gi @@ -61,13 +61,19 @@ end); ## Helpers for the constructors below: ArgHelper@ := function(parmlist) - # returns a list of the family and the flat list of elements of parmlist + local fam; + # returns a list of the family and the list of elements of parmlist if Length(parmlist) = 0 then Error("usage: RAQ constructors take an optional family, followed by gens"); fi; - if IsFamily(parmlist[1]) then return [Remove(parmlist,1), Flat(parmlist)]; fi; - parmlist := Flat(parmlist); - return [FamilyObj(parmlist), parmlist]; + fam := fail; + if IsFamily(parmlist[1]) then fam := Remove(parmlist,1); fi; + if Length(parmlist) = 1 and IsList(parmlist[1]) + and not IsDirectProductElement(parmlist[1]) then + parmlist := parmlist[1]; + fi; + if fam = fail then fam := FamilyObj(parmlist); fi; + return [fam, parmlist]; end; CheckLQGprop@ := function(gens)