Hello GAP forum I'm puzzled as to why the following code, which I think should work, does not. I have reduced the situation to the following:
--------------- start tempo.gap DeclareCategory("IsMyStruct", IsObject); StrFamily := NewFamily("MyStructsFamily"); StrType := NewType(StrFamily, IsMyStruct); DeclareRepresentation("StrRep", IsComponentObjectRep and IsAttributeStoringRep, ["uno", "dos"]); CreateStr := function(u,v) return Objectify(StrType,rec(uno:=u,dos:=v)); end; InstallMethod(PrintObj,[IsMyStruct],function(S) Print("uno=",S!.uno,"dos=",S!.dos); end); InstallMethod(ViewObj,[IsMyStruct],function(S) Print("uno=",S!.uno,"dos=",S!.dos); end); DeclareAttribute("MyAtr",IsMyStruct); InstallMethod(MyAtr,[IsMyStruct],function(S) return("hello"); end); DeclareProperty("MyProp",IsMyStruct); InstallMethod(MyProp,[IsMyStruct],function(S) return false; end); --------------- end tempo.gap then, after loading in a GAP 4.8.2 session, started with "gap -r": I get: gap> Read("tempo.gap"); gap> S:=CreateStr(1,2); uno=1dos=2 gap> MyAtr(S); "hello" gap> KnownAttributesOfObject(S); [ ] why is that? However, storing of properties work? gap> MyProp(S); false gap> KnownPropertiesOfObject(S); [ "MyProp" ] Thanks in advance for any help. Rafael _______________________________________________ Forum mailing list Forum@mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum