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

raise julia errors #525

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

schlichtanders
Copy link

fixes #508

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.92%. Comparing base (1517803) to head (05a680e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #525      +/-   ##
==========================================
- Coverage   80.40%   77.92%   -2.49%     
==========================================
  Files          26       26              
  Lines        1684     1685       +1     
==========================================
- Hits         1354     1313      -41     
- Misses        330      372      +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/callback.jl Outdated
nprotect = 2
local clos
try
args = protect(sexp_arglist_dots())
args = RCall.protect(RCall.sexp_arglist_dots())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
args = RCall.protect(RCall.sexp_arglist_dots())
args = protect(sexp_arglist_dots())

src/callback.jl Outdated
Comment on lines 151 to 152
lang = RCall.rlang_p(:function, args, body)
clos = RCall.reval_p(lang)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lang = RCall.rlang_p(:function, args, body)
clos = RCall.reval_p(lang)
lang = rlang_p(:function, args, body)
clos = reval_p(lang)

src/callback.jl Outdated
finally
unprotect(nprotect)
RCall.unprotect(nprotect)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RCall.unprotect(nprotect)
unprotect(nprotect)

src/callback.jl Outdated
Comment on lines 139 to 149
args = protect(sexp_arglist_dots())
args = RCall.protect(RCall.sexp_arglist_dots())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to qualify things from RCall when executing within RCall. (If you were overwriting these methods from an external definition, then you do need that qualification.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for all the changes. yes indeed I was previously overwriting it but as this got discouraged like an error in julia 1.10 I switched to forking RCall. These were apparently some leftovers

Copy link
Collaborator

@palday palday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally onboard with this, but it needs tests of the new behavior. 😄

@schlichtanders
Copy link
Author

@palday I took away the RCall. qualifier. Can you point me to the place where you would like to have the test?

@ViralBShah
Copy link
Contributor

I believe the test to have is something that checks for the new julia error being raised as expected in this PR, so we don't regress.

@palday
Copy link
Collaborator

palday commented May 16, 2024

@schlichtanders there is an entry with the comment "callbacks" in the tests folder:

https://github.com/JuliaInterop/RCall.jl/blob/master/test/basic.jl#L67

That seems like a good place to put it. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants