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

Headers generated from interfaces uses invalid C++ when exported name has dot #402

Closed
jackwasey opened this issue Nov 24, 2015 · 5 comments

Comments

@jackwasey
Copy link
Contributor

The attributes vignette describes how to name a function using
// [[Rcpp:export(name="something.dot")]]
allowing use of . prefix or S3 methods. However, when
// [[Rcpp::interfaces(r, cpp)]]
is used, the generated header file uses the exported name (perhaps correctly), but when an S3 method is exported, the header includes things like:

    inline List rcpp.dot() {
      typedef SEXP(*Ptr_rcpp.dot)();

which don't compile.

To replicate:

Rcpp.package.skeleton()

Then change the attributes in src/rcpp_hello_world.cpp to:

// [[Rcpp::interfaces(r, cpp)]]
// [[Rcpp::export(name="rcpp.dot")]]

Then attempt to compile. I used devtools::load_all(). Without // [[Rcpp::interfaces(r, cpp)]] it compiles fine.

@eddelbuettel
Copy link
Member

That puts a second issue on @jjallaire 's plate...

@jjallaire
Copy link
Member

PR with a fix is here: #403

On Tue, Nov 24, 2015 at 7:54 PM, Dirk Eddelbuettel <notifications@github.com

wrote:

That puts a second issue on @jjallaire https://github.com/jjallaire 's
plate...


Reply to this email directly or view it on GitHub
#402 (comment).

@eddelbuettel
Copy link
Member

Lovely, thank you!

@jackwasey
Copy link
Contributor Author

Lightning fast as always. Thanks.

@eddelbuettel
Copy link
Member

That's Rcpp's slogan, isn't it? ;-)

eddelbuettel added a commit that referenced this issue Nov 27, 2015
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

No branches or pull requests

3 participants