propagate finiteness at construction time

This commit is contained in:
Glen Whitney 2017-10-20 16:45:11 +02:00
parent 9af5d627d8
commit 1266a5ed34
1 changed files with 5 additions and 1 deletions

View File

@ -33,13 +33,17 @@ end);
InstallGlobalFunction(CloneOfTypeByGenerators, InstallGlobalFunction(CloneOfTypeByGenerators,
function(cat, fam, gens, genAttrib, tableCstr) function(cat, fam, gens, genAttrib, tableCstr)
local M; local M, elf;
if not(IsEmpty(gens) or IsIdenticalObj(FamilyObj(gens), fam)) then if not(IsEmpty(gens) or IsIdenticalObj(FamilyObj(gens), fam)) then
Error("<fam> and family of <gens> do not match"); Error("<fam> and family of <gens> do not match");
fi; fi;
M := Objectify(NewType( fam, cat and IsAttributeStoringRep), rec()); M := Objectify(NewType( fam, cat and IsAttributeStoringRep), rec());
Setter(genAttrib)(M, AsList(gens)); Setter(genAttrib)(M, AsList(gens));
SetConstructorFromTable(M, tableCstr); SetConstructorFromTable(M, tableCstr);
elf := ElementsFamily(fam);
# Since there doesn't seem to be a way to make the IsFinite method based
# on the family being finite into an immediate method:
if HasIsFinite(elf) and IsFinite(elf) then SetIsFinite(M, true); fi;
return M; return M;
end); end);