From 1266a5ed341d7658d21c244d547ab2e4686ce060 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Fri, 20 Oct 2017 16:45:11 +0200 Subject: [PATCH] propagate finiteness at construction time --- gap/structure.gi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gap/structure.gi b/gap/structure.gi index 0d1e5c0..4f3b8d7 100644 --- a/gap/structure.gi +++ b/gap/structure.gi @@ -33,13 +33,17 @@ end); InstallGlobalFunction(CloneOfTypeByGenerators, function(cat, fam, gens, genAttrib, tableCstr) - local M; + local M, elf; if not(IsEmpty(gens) or IsIdenticalObj(FamilyObj(gens), fam)) then Error(" and family of do not match"); fi; M := Objectify(NewType( fam, cat and IsAttributeStoringRep), rec()); Setter(genAttrib)(M, AsList(gens)); 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; end);