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

Add invisible param to export attribute #1025

Merged
merged 5 commits into from
Nov 18, 2019

Conversation

renkun-ken
Copy link
Contributor

@renkun-ken renkun-ken commented Nov 18, 2019

Closes #1024.

This PR add invisible param to export attribute so that if Rcpp::export(invisible=true) is specified, the R wrapper will use invisible(.Call(...)) instead of .Call(...).

Checklist

  • Code compiles correctly
  • R CMD check still passes all tests
  • Prefereably, new tests were added which fail without the change
  • Document the changes by file in ChangeLog
  • The corresponding Rcpp Attributes vignette is updated accordingly.

src/attributes.cpp Outdated Show resolved Hide resolved
@eddelbuettel
Copy link
Member

Looks fine in general, but I would of course like to know what @jjallaire thinks here.

I also added an item to the checklist to make sure the corresponding vignette reflects it.

@renkun-ken
Copy link
Contributor Author

I don't see any unit test about export params. Should I add tests about [[ Rcpp::export(invisible=true) ]]?

@eddelbuettel
Copy link
Member

Good question. I don't think we have any, and should maybe table it. Would be nice to ascertain that we can turn visible on/off, that we can renamed (test could use exists() after the build I suppose) but less sure about the RNG option.

Your PR is fine by me now. I will just wait for @jjallaire to glance at it too.

So thanks for the PR and the quick refinements!

ChangeLog Outdated Show resolved Hide resolved
@renkun-ken
Copy link
Contributor Author

Thanks for your kind suggestions!

@@ -29,14 +34,14 @@

* R/Attributes.R: Correct how cppFunction() deals with multiple
depends arguments

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: please avoid whitespace-only changes when possible; consider configuring your editor to only trim whitespace on the lines you've edited

Copy link
Member

Choose a reason for hiding this comment

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

That hit me the other day too. So I just googled it for The One True Editor: https://www.emacswiki.org/emacs/DeletingWhitespace#toc11

Will give that a spin myself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for not noticing the auto formatting. I'll disable auto formatting for the project.

Copy link
Contributor

@kevinushey kevinushey left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@jjallaire jjallaire left a comment

Choose a reason for hiding this comment

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

LGTM as well!

@eddelbuettel eddelbuettel merged commit d6594ba into RcppCore:master Nov 18, 2019
eddelbuettel added a commit that referenced this pull request Nov 19, 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.

Need a way to return invisible
4 participants