[GAP Forum] NewAttribute function

Nelson Silva nelson at mcs.st-and.ac.uk
Thu Jan 29 19:56:09 GMT 2004


Hi!

I'm sorry if this has a trivial answer.

I am trying to store some data, obtained from some functions I wrote, in a
way that this information can be accessed using the command
"KnownAttributesOfObject"

I am trying to define some new attribute (using the instructions on the
online manual) by typing "NewAttribute( <unary operation>, <filter> )" but
the output I get is


"usage: NewAttribute( <name> ) at
getter := NEW_ATTRIBUTE( name );"



This <unary operation> has been declared with the "DeclareOperation"
command in a .gd file and with the "InstallMethod" command in a .gi file.

Can this be the reason why it does not work?

Can someone give me a simple example for the creation of a new attribute?

Many thanks,


-- 

Nelson Silva
--------------------------------------------------------------
Algebra Group                                                -
http://www-maths.mcs.st-and.ac.uk/pg/pure/Algebra/index.html -
--------------------------------------------------------------
Tel   :: +44 (0)133 4 46 3227                                -
Fax   :: +44 (0)133 4 46 3748                                -
E-mail:: nelson at mcs.st-and.ac.uk                             -
Web   :: http://turnbull.mcs.st-and.ac.uk/~nelson            -
--------------------------------------------------------------
Mathematical Institute                                       -
North Haugh                                                  -
St. Andrews                                                  -
Fife   KY16 9SS                                              -
SCOTLAND       UK                                            -
--------------------------------------------------------------





More information about the Forum mailing list