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

Update Attributes.R (closes #1017) #1016

Merged
merged 1 commit into from Nov 9, 2019
Merged

Conversation

@tjmckinley
Copy link
Contributor

@tjmckinley tjmckinley commented Nov 9, 2019

When passing multiple "depends" arguments to "cppFunction" e.g.

cppFunction(code, depends = c("package1", "package2"))

this was producing code with scaffolding:

// [[Rcpp:depends(package1)]]
// [[Rcpp:depends(package2)]]
#include <package1.h>
#include <Rcpp.h>

rather than

// [[Rcpp:depends(package1, package2)]]
#include <package1.h>
#include <package2.h>
#include <Rcpp.h>
Corrected parsing of multiple "depends" statements in "cppFunction".
Copy link
Contributor

@coatless coatless left a comment

Good catch! LGTM.

@tjmckinley
Copy link
Contributor Author

@tjmckinley tjmckinley commented Nov 9, 2019

No worries. Thanks to all for producing such a useful package!

@coatless
Copy link
Contributor

@coatless coatless commented Nov 9, 2019

@tjmckinley while you're at it... Mind fixing the code for plugins as well? c.f.

Rcpp/R/Attributes.R

Lines 258 to 259 in 975361f

plugins <- paste(plugins, sep=", ") # #nocov start
pluginsAttrib <- paste("// [[Rcpp::plugins(", plugins, ")]]", sep="")

@eddelbuettel
Copy link
Member

@eddelbuettel eddelbuettel commented Nov 9, 2019

@tjmckinley Thank you. Please also consider reading Contributing before sending PRs.

What is the motivation for the PR? What it fixes is not a defect but an aesthetic preference. Which would change something used as it currently is and was by lots of people. We generally don't do that without good reason.

@tjmckinley
Copy link
Contributor Author

@tjmckinley tjmckinley commented Nov 9, 2019

My apologies @eddelbuettel. I will log an issue now with a reprex.

@tjmckinley
Copy link
Contributor Author

@tjmckinley tjmckinley commented Nov 9, 2019

Hi @eddelbuettel. I've logged an issue (#1017) with a reprex. It's not purely aesthetic in this case since the code won't compile for the example since the header file for RcppArmadillo is not found. For example, running a function of the form

cppFunction(code, depends = c("package1", "package2"))

produces code with scaffolding:

// [[Rcpp:depends(package1)]]
// [[Rcpp:depends(package2)]]
#include <package1.h>
#include <Rcpp.h>

with no #include <package2.h>. This is caused simply by the cppFunction() code not parsing the depends argument correctly.

Many thanks,

TJ

@tjmckinley
Copy link
Contributor Author

@tjmckinley tjmckinley commented Nov 9, 2019

By the way, many thanks @eddelbuettel, @coatless for producing this fantastic package. I can't do without it! Apologies also if I take a while to reply. I'm in Japan and hence the time difference causes a lag in response time.

@tjmckinley
Copy link
Contributor Author

@tjmckinley tjmckinley commented Nov 9, 2019

@tjmckinley while you're at it... Mind fixing the code for plugins as well? c.f.

Rcpp/R/Attributes.R

Lines 258 to 259 in 975361f

plugins <- paste(plugins, sep=", ") # #nocov start
pluginsAttrib <- paste("// [[Rcpp::plugins(", plugins, ")]]", sep="")

Yes @coatless. Happy to do this if you and @eddelbuettel think this is an issue.

@jjallaire
Copy link
Member

@jjallaire jjallaire commented Nov 9, 2019

LGTM as well.

@eddelbuettel eddelbuettel changed the title Update Attributes.R Update Attributes.R (closes #1017) Nov 9, 2019
@eddelbuettel
Copy link
Member

@eddelbuettel eddelbuettel commented Nov 9, 2019

Looks good to me too after a closer look; merging.

@eddelbuettel eddelbuettel merged commit bbd7365 into RcppCore:master Nov 9, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tjmckinley tjmckinley mentioned this pull request Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.