Objectify( type, data ) F
New objects are created by Objectify.
data is a list or a record, and type is the type that the desired
object shall have.
Objectify turns data into an object with type type.
That is, data is changed, and afterwards it will not be a list or a
record unless type is a type of a list resp. record.
If data is a list then Objectify turns it into a positional object,
if data is a record then Objectify turns it into a component object
(for examples, see Component Objects and Positional Objects).
Objectify does also return the object that it made out of data.
For examples where Objectify is used, see Component Objects,
Positional Objects,
and the example in Chapter An Example -- Residue Class Rings.
Attribute assignments will change the type of an object. If you create many objects code of the form
o:=Objectify(type,rec()) SetMyAttribute(o,value);will take much time for type changes. You can avoid this by setting the attributes immediatley while the object is created:
ObjectifyWithAttributes(obj,type,Attr1,val1[,Attr2,val2...]) F
changes the type of object obj to type type and sets attribute Attr1 set to val1, attribute Attr2 set to val2 and so forth.
If the filter list of type includes that these attributes are set (and for propertries also includes the value of the property) and if no special setter methods are installed for any of the involved attributes this is done simultaneously without type changes which may give a substantial speedup.
If the conditions of the last sentence are nort fulfilled, instead an
ordinary Objectify with subsequential Setter calls for the attributes is
performed.
[Top] [Previous] [Up] [Next] [Index]
GAP 4 manual