gap-packages/YangBaxter

Improving setting Size (and possibly other attributes)

Closed this issue · 1 comments

Consider example:

gap> br:=SmallSkewBrace(8,1);
A skew brace of size 8
gap> KnownAttributesOfObject(br);
[  ]

So br knows its Size, it is displayed in the output, but it is not yet a known attribute. However, we have:

gap> br:=SmallSkewBrace(8,1);
A skew brace of size 8
gap> Size(br);
8
gap> KnownAttributesOfObject(br);
[ "Size" ]

The reason is that Size is not declared as an attribute for IsSkewBrace in skew.gd and then installed as other method in

YangBaxter/gap/skew.gi

Lines 24 to 27 in 6434fda

InstallOtherMethod(Size, "for skew braces", [ IsSkewBrace ],
function(obj)
return obj!.size;
end);

Instead, it should be declared as attribute, and then the call of Objectify in

YangBaxter/gap/skew.gi

Lines 16 to 21 in 6434fda

return Objectify(SkewBraceType, rec(
size := Size(additive),
additive := additive,
multiplicative := multiplicative,
p := MappingByFunction(additive, multiplicative, x->First(p, y->IsOne(y[1]*Inverse(x)))[2]),
));
should be replaced by ObjectifyWithAttributes. Other components should be also handled in the same way.

Done as a part of 7ccf14d