propagate finiteness at construction time
This commit is contained in:
parent
9af5d627d8
commit
1266a5ed34
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue