[GAP Forum] Forum discussion on packages and global function names

Yevgen Muntyan muntyan at tamu.edu
Thu May 3 14:21:31 BST 2007


Steve Linton wrote:
> Dear GAP Forum,
>
> Yevgen Muntyan's post and the discussion which follows raise the question of
> managing the global variable namespace as the number of packages in GAP grows. 
>
> Some guidelines in this direction appear on the Web site at
> http://www.gap-system.org/Packages/Authors/variablenames.html. 
>   

That's a nice link, indeed. And I haven't seen it until after I have sent
this letter, even though that page is quite visible on the web page,
and mentioned in the manual :)

> To answer specifically Yevgen's question: 
>
>   
>> Should packages use operations as much as possible? 
>>     
>
> the answer, as explained on that page is "basically yes". Indeed, where
> appropriate, Attributes should even be preferred to Operations. 
>   
Why should Attributes be preferred to Operations? Does it make something
faster? We can have operation with the same name declared and defined

for totally different objects, so the only difference between operation and
attribute seems to be that attribute value is stored. Or is there something
else?


[snip]
> I should say that there is one awkward exception to this generally good
> performance, namely when one of the arguments is a plain list with mutable
> entries. In this case determining its type must be repeated at every operation
> call, and can be expensive. We have some longer term plans to address this,
> but thy will involve significant changes and will take a while to work through.
>   
Do you mean that it takes much time to distinguish between

InstallMethod(Foobar, [IsList], ...)
InstallMethod(Foobar, [IsList and IsSomeCollection], ...)

or any operation which has a method installed for a list is affected?

Thank you,
Yevgen



More information about the Forum mailing list