> < ^ Date: Wed, 16 Sep 1998 16:58:34 -0700
> < ^ From: Jacob Hirbawi <hirbawi@commquest.com >
> ^ Subject: Overloading Operations in GAP4

Dear GAP forum,

I am having trouble figuring out how overloading operations is done in
GAP4.
The GAP3 equivalent of what I'm tryuing to do is :

MyOps:=rec();
MyOps.\+:=function(a,b) return rec(x:=a.x+b.x+7,operations:=MyOps);end;
A:=rec(x:=3,operations:=MyOps);
B:=rec(x:=5,operations:=MyOps);

so if I then type A+B I would get rec(x:=15,operations:=MyOps);

I read the section about extending GAP, but I'm still not sure about the

process; thanks for your help.

Jacob Hirbawi


> < [top]