Basicaly what I'm trying to do is this:
Expose all the functions/operations(I thought again about it and I
think they should also be included) in a registry for example by name
and arguments and the package it belongs to. Then from a webservice
that acts as a gap wrapper i want to be able to call a certain
function with certain parameters. Functions can be added later, so I
goes that from time to time a program will check for new appearences.
Basically this is it. For now I have the service wrapper and i want to
get the available functions, their arguments and parent package.
Regards.
Marc Frincu.
Quoting Laurent Bartholdi <[EMAIL PROTECTED]>:
One more thing and I have no more questions:
Don't worry!
Is there a way to find out the functions in a certain package? I know
that there is a way to display a package but a way to see what
functions it contains? (Perhaps a raw method of A:=the function list
when gap is started with no package; B:=the function list after the
package is loaded; C:=B-A ???)
Yes, that should work. You may also assume that the package installs
functions via DeclareGlobalFunction and InstallGlobalFunction. Then
either use 'grep' to scan through the code, or use
old_DeclareGlobalFunction := DeclareGlobalFunction;
MakeReadWriteGlobal("DeclareGlobalFunction");
funcs := [];
DeclareGlobalFunction := function(arg) Add(funcs,arg[1]);
CallFuncList(old_DeclareGlobalFunction,arg); end;
which redefine DeclareGlobalFunction to first store its first argument
in a list "funcs", and then call the original command.
it seems strange that you want a list of functions without using the
documentation. I assume it's because you want to automate some process
and don't trust the documentation to be up-to-date or easily useable
from within a program. If you're a bit more specific with what you
want to do, we can help you better.
best, laurent
Best regards,
Marc Frincu
Quoting Laurent Bartholdi <[EMAIL PROTECTED]>:
On 1/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Thanks for your answers.
It works but I have one more problem. Not all the results (when using:
Filtered(NamesSystemGVars(), str-> IsBoundGlobal(str) and
IsFunction(ValueGlobal(str)));) are functions. I also get results like
[]:=, or {}:= or operations which I do not need. Is there any way to
further filter the results?
Well, it seems you replied to your own question :)
Filtered(NamesSystemGVars(), str-> IsBoundGlobal(str) and
IsFunction(ValueGlobal(str)) and not IsOperation(ValueGlobal(str)));
--
Laurent Bartholdi \ laurent.bartholdi<at>gmail<dot>com
EPFL SB SMA IMB MAD \ Téléphone: +41 21-6935458
Station 8 \ Secrétaire: +41 21-6935501
CH-1015 Lausanne, Switzerland \ Fax: +41 21-6930339
--
Laurent Bartholdi \ laurent.bartholdi<at>gmail<dot>com
EPFL SB SMA IMB MAD \ Téléphone: +41 21-6935458
Station 8 \ Secrétaire: +41 21-6935501
CH-1015 Lausanne, Switzerland \ Fax: +41 21-6930339
_______________________________________________
Forum mailing list
[email protected]
http://mail.gap-system.org/mailman/listinfo/forum