From c0466aa93828f4eda55d59eaed87e4139365dc2a Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Tue, 1 May 2018 14:14:25 -0600 Subject: [PATCH] Changed comments in response to github remarks. --- lib/coll.gi | 13 +++++++++---- lib/csetgrp.gi | 7 ++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/coll.gi b/lib/coll.gi index 7ea5542144..f46882f9a0 100644 --- a/lib/coll.gi +++ b/lib/coll.gi @@ -3053,16 +3053,21 @@ end); InstallMethod( CanComputeIsSubset,"default: no, unless identical", [IsObject,IsObject],IsIdenticalObj); -# avoid immediate methods triggering multiple type changes once the Size of -# an object is known. +# This setter method is installed to implement filter settings in response +# to an objects size as part of setting the size. This used to be handled +# instead by immediate methods, but in a situation as here it would trigger +# multiple immediate methods, several of which could apply and each changing +# the type of the object. Doing so can be costly and thus should be +# avoided. InstallOtherMethod(SetSize,true,[IsObject and IsAttributeStoringRep,IsObject], 100, # override system setter function(obj,sz) local filt; if HasSize(obj) and Size(obj)<>sz then if AssertionLevel()>2 then - # Make this an ordinary error to enter break loop so that one can - # investigate call order for debugging + # Make this an ordinary error (not ErrorNoReturn as suggested) to + # preserve all debugging options -- even use `return` to investigate + # what would have happened before this methods was introduced. Error("size of ",obj," already set to ",Size(obj), ", cannot be changed to ",sz); fi; diff --git a/lib/csetgrp.gi b/lib/csetgrp.gi index ff71d63f0e..44c5c84478 100644 --- a/lib/csetgrp.gi +++ b/lib/csetgrp.gi @@ -586,7 +586,12 @@ local d,fam,typ; ActingDomain,U,FunctionAction,OnLeftInverse,Representative,g, CanonicalRepresentativeDeterminatorOfExternalSet, RightCosetCanonicalRepresentativeDeterminator); - SetSize(d,Size(U)); # as own setter + # We cannot set the size in the previous ObjectifyWithAttributes as there is + # a custom setter method (the one added in this commit). In such a case + # ObjectifyWith Attributes just does `Objectify` and calls all setters + # separately which is what we want to avoid here. + SetSize(d,Size(U)); + return d; end);