Flat() is too destructive on the parmlist; e.g. it destroys DirectProductElements

This commit is contained in:
Glen Whitney 2017-10-29 14:36:56 -04:00
parent 8c939b4a91
commit b089e131d1

View File

@ -61,13 +61,19 @@ end);
## Helpers for the constructors below: ## Helpers for the constructors below:
ArgHelper@ := function(parmlist) 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 if Length(parmlist) = 0 then
Error("usage: RAQ constructors take an optional family, followed by gens"); Error("usage: RAQ constructors take an optional family, followed by gens");
fi; fi;
if IsFamily(parmlist[1]) then return [Remove(parmlist,1), Flat(parmlist)]; fi; fam := fail;
parmlist := Flat(parmlist); if IsFamily(parmlist[1]) then fam := Remove(parmlist,1); fi;
return [FamilyObj(parmlist), parmlist]; 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; end;
CheckLQGprop@ := function(gens) CheckLQGprop@ := function(gens)