Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perhaps use ObjectifyWithAttributes instead of Objectify #2

Open
fingolfin opened this issue Sep 15, 2015 · 1 comment
Open

Perhaps use ObjectifyWithAttributes instead of Objectify #2

fingolfin opened this issue Sep 15, 2015 · 1 comment

Comments

@fingolfin
Copy link
Member

fingolfin commented Sep 15, 2015

You may want to consider using ObjectifyWithAttributes instead of Objectify where suitable. It is somewhat more efficient. Perhaps it doesn't matter for you now, but if you create a lot of objects, it can add up.

For example, this could

    map := Objectify( NewType( CollectionsFamily( GeneralMappingsFamily(
                   ElementsFamily( FamilyObj( M ) ),
                   ElementsFamily( FamilyObj( N ) ) ) ), 
                   IsPathAlgebraMatModuleHomomorphism and IsPathAlgebraMatModuleHomomorphismRep ), rec( maps := linmaps ));
    SetPathAlgebraOfMatModuleMap(map, A);
    SetSource(map, M);
    SetRange(map, N);  
    SetIsWholeFamily(map, true);

could be rewritten like this:

    type := NewType( CollectionsFamily( GeneralMappingsFamily(
                   ElementsFamily( FamilyObj( M ) ),
                   ElementsFamily( FamilyObj( N ) ) ) ), 
                   IsPathAlgebraMatModuleHomomorphism and IsPathAlgebraMatModuleHomomorphismRep and IsWholeFamily );
    map := rec( maps := linmaps );
    ObjectifyWithAttributes(
            map, type,
            PathAlgebraOfMatModuleMap, A,
            Source, M,
            Range, N
    );
@oysteins
Copy link
Contributor

Yes, we use ObjectifyWithAttributes in version 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants