-
Notifications
You must be signed in to change notification settings - Fork 160
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
Show files/location for compiled functions #755
Conversation
Looks nice. Is there a way now to distinguish between the kernel and compiled code by its location and show e.g.
and
? |
Yes, but I'm just trying to think of a neat way to do it, rather than something hacky, or wasting bits. |
5bbc7c5
to
c9fd41f
Compare
Now tweaked (also added some kernel comments in case anyone else ever comes and reads this code). Decided to write
|
Don't merge this -- something weird going on : EDIT, nope, weirdness has always been there, ignore this. |
ArgStringToList( tab[i].args ), | ||
tab[i].handler ); | ||
SetupFuncInfo( func, tab[i].cookie ); | ||
AssGVar( gvar, func ); | ||
MakeReadOnlyGVar( gvar ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that some kernel extensions in packages do not use InitGVarFuncsFromTable
.
So I wonder: Will it be safe to use function for which SetupFuncInfo
has not been invoked? I assume yes, but I wanted to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Such functions will continue to show no position, as they always did.
For the record, if merged, this would close issue #745. |
c9fd41f
to
e041282
Compare
This code has had a general spring clean, is now (hopefully) better defined, don't abuse the same variable for multiple uses. |
@ChrisJefferson I was surprised by the following side-effect when all packages are loaded:
because ToolsForHomalg has the following lines:
Does the failing command from the test file check anything special, like 2-argument function? Otherwise, it may be removed since next command from the test files looks very similar and works. |
It is testing something useful (non-variadic printing). Could you try replacing it with:
Which should hopefully work (I think I've got the number right). |
Is there a new line missing somewhere? This is what I am getting:
|
Bah, I hate that stupid lack of newline at the end of functions. Should get around to fixing it.
|
This avoids diffs when ToolsForHomalg package is loaded (see #755)
This patch makes GAP show information about where kernel or compiled functions come from. This is best illustrated by an example!
RETURN_FIRST
is a kernel function,RunImmediateMethods
andInstallMethod
are both from oper1.g, which is compiled.For compiled GAP code, we already knew this info, we just weren't displaying it. For C functions, I use the 'cookie' value, which is usually set by convention to
filename:Cfunction
. We should probably document that we are now using the cookie information for this purpose (if the cookie doesn't have a:
in it, we just ignore it and don't try to extract filename/function information).