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

Place call_gap_func in the main module to ensure it is accessible #269

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

sebasguts
Copy link
Contributor

even when the GAP module is not loaded into main (e.g., if loaded
from another module)

Copy link
Contributor

@mohamed-barakat mohamed-barakat left a 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.

src/GAP.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 26, 2019

Codecov Report

Merging #269 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master     #269   +/-   ##
=======================================
  Coverage   70.06%   70.06%           
=======================================
  Files          50       50           
  Lines        3260     3260           
=======================================
  Hits         2284     2284           
  Misses        976      976
Impacted Files Coverage Δ
src/GAP.jl 91.89% <100%> (ø) ⬆️

@sebasguts
Copy link
Contributor Author

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...)
Copy link
Member

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?

Suggested change
(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?

Copy link
Member

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?

Copy link
Contributor Author

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).

Copy link
Contributor Author

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)
Copy link
Member

@fingolfin fingolfin left a 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 :-)

@fingolfin fingolfin merged commit 8ab6522 into oscar-system:master Jun 27, 2019
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

Successfully merging this pull request may close these issues.

3 participants