-
Notifications
You must be signed in to change notification settings - Fork 22
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
Place call_gap_func
in the main module to ensure it is accessible
#269
Conversation
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.
Works for me. Thank you very much.
f914383
to
549af58
Compare
Codecov Report
@@ Coverage Diff @@
## master #269 +/- ##
=======================================
Coverage 70.06% 70.06%
=======================================
Files 50 50
Lines 3260 3260
=======================================
Hits 2284 2284
Misses 976 976
|
Done. |
src/GAP.jl
Outdated
Base.MainInclude.eval(:( | ||
(func::$MPtr)(args...; kwargs...) = GAP.call_gap_func(func, args...; kwargs...) | ||
(func::$MPtr)(args...; kwargs...) = $(call_gap_func)(func, args...; kwargs...) |
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.
So it doesn't work like this, without the global
above?
(func::$MPtr)(args...; kwargs...) = $(call_gap_func)(func, args...; kwargs...) | |
(func::$MPtr)(args...; kwargs...) = $(GAP.call_gap_func)(func, args...; kwargs...) |
I just tested that locally, and it seemed to work fine? If there is no reason, let's use mine. If there is a reason, let's add a comment explaining it?
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.
@sebasguts am I missing something?
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.
@fingolfin I am not completely sure if this also works when GAP is loaded as a dependency of another module. Will test, and then change it accordingly (either comment or your version).
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.
Tested, and your approach is valid. I updated the PR.
even when the GAP module is not loaded into main (e.g., if loaded from another module)
549af58
to
15b0972
Compare
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.
Nice, tight and sweet :-)
even when the GAP module is not loaded into main (e.g., if loaded
from another module)