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
1 changed files with 10 additions and 4 deletions

View File

@ -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)